home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / netbsd / experimental / bin10 / mw-1.0a-941229-diffs < prev    next >
Text File  |  1995-03-31  |  65KB  |  2,297 lines

  1. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/adosglue.h sys/arch/amiga/amiga/adosglue.h
  2. *** sys.orig/arch/amiga/amiga/adosglue.h    Tue Dec 20 09:33:07 1994
  3. --- sys/arch/amiga/amiga/adosglue.h    Thu Dec 22 21:12:39 1994
  4. ***************
  5. *** 56,63 ****
  6.   #define ADT_NETBSDSWAP    3
  7.   #define ADT_NETBSDUSER    4
  8. ! #define ADT_AMIX    5
  9.   
  10.   #define ISFSARCH_NETBSD(adt) \
  11. !     ((adt).archtype >= ADT_NETBSDROOT && (adt).archtype <= ADT_NETBSDUSER)
  12.   
  13.   #endif /* _ADOSGLUE_H_ */
  14. --- 56,64 ----
  15.   #define ADT_NETBSDSWAP    3
  16.   #define ADT_NETBSDUSER    4
  17. ! #define ADT_NETBSDUSPEC    5
  18. ! #define ADT_AMIX    6
  19.   
  20.   #define ISFSARCH_NETBSD(adt) \
  21. !     ((adt).archtype >= ADT_NETBSDROOT && (adt).archtype <= ADT_NETBSDUSPEC)
  22.   
  23.   #endif /* _ADOSGLUE_H_ */
  24. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/amiga_init.c sys/arch/amiga/amiga/amiga_init.c
  25. *** sys.orig/arch/amiga/amiga/amiga_init.c    Tue Dec 20 09:33:07 1994
  26. --- sys/arch/amiga/amiga/amiga_init.c    Tue Dec 27 21:41:36 1994
  27. ***************
  28. *** 52,55 ****
  29. --- 52,60 ----
  30.   
  31.   /*
  32. +  * these are used by the extended spl?() macros.
  33. +  */
  34. + volatile unsigned short *amiga_intena_read, *amiga_intena_write;
  35. + /*
  36.    * the number of pages in our hw mapping and the start address
  37.    */
  38. ***************
  39. *** 647,650 ****
  40. --- 652,662 ----
  41.       ciaa.icr = 0x7f;            /* and keyboard */
  42.       ciab.icr = 0x7f;            /* and again */
  43. +     /*
  44. +      * remember address of read and write intena register for use
  45. +      * by extended spl?() macros.
  46. +      */
  47. +     amiga_intena_read  = &custom.intenar;
  48. +     amiga_intena_write = &custom.intena;
  49.   
  50.       /*
  51. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/autoconf.c sys/arch/amiga/amiga/autoconf.c
  52. *** sys.orig/arch/amiga/amiga/autoconf.c    Tue Dec 20 09:33:07 1994
  53. --- sys/arch/amiga/amiga/autoconf.c    Tue Dec 27 19:41:22 1994
  54. ***************
  55. *** 67,70 ****
  56. --- 67,74 ----
  57.       
  58.       custom.intena = INTF_SETCLR | INTF_INTEN;
  59. +     /* also enable hardware aided software interrupts */
  60. +     custom.intena = INTF_SETCLR | INTF_SOFTINT;
  61.   #ifdef GENERIC
  62.       if ((boothowto & RB_ASKNAME) == 0)
  63. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/conf.c sys/arch/amiga/amiga/conf.c
  64. *** sys.orig/arch/amiga/amiga/conf.c    Tue Dec 20 09:33:07 1994
  65. --- sys/arch/amiga/amiga/conf.c    Thu Dec 22 21:12:39 1994
  66. ***************
  67. *** 513,516 ****
  68. --- 513,534 ----
  69.   }
  70.   
  71. + #include "tun.h"
  72. + #define tunioctl tuncioctl
  73. + cdev_decl(tun);
  74. + #if NTUN > 0
  75. + #define cdev_tun_init(c,n) {\
  76. +         dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
  77. +         dev_init(c,n,write), dev_init(c,n,ioctl), \
  78. +         (dev_type_stop((*))) enodev, (dev_type_reset((*))) nullop, \
  79. +         0, dev_init(c,n,select), (dev_type_map((*))) enodev, 0 }
  80. + #else
  81. + #define cdev_tun_init(c, n) {\
  82. +         (dev_type_open((*))) enodev, (dev_type_close((*))) enodev, \
  83. +         (dev_type_read((*))) enodev, (dev_type_write((*))) enodev, \
  84. +         (dev_type_ioctl((*))) enodev, (dev_type_stop((*))) enodev, \
  85. +         (dev_type_reset((*))) nullop, 0, \
  86. +         (dev_type_select((*))) enodev, (dev_type_map((*))) enodev, 0 }
  87. + #endif
  88.   
  89.   #ifdef LKM
  90. ***************
  91. *** 580,585 ****
  92.       cdev_fd_init(1),        /* 21: file descriptor pseudo-dev */
  93.       cdev_bpf_init(NBPFILTER),    /* 22: berkeley packet filter */
  94. !     cdev_notdef(),            /* 23: */
  95. !     cdev_lkm_init(NLKM),    /* 24: loadable kernel modules pdev */
  96.       LKM_CDEV(),            /* 25: Empty slot for LKM */
  97.       LKM_CDEV(),            /* 26: Empty slot for LKM */
  98. --- 598,603 ----
  99.       cdev_fd_init(1),        /* 21: file descriptor pseudo-dev */
  100.       cdev_bpf_init(NBPFILTER),    /* 22: berkeley packet filter */
  101. !         cdev_tun_init(NTUN,tun),        /* 23: IP tunnel pseudo-device */
  102. !     cdev_lkm_init(NLKM),        /* 24: loadable kernel modules pdev */
  103.       LKM_CDEV(),            /* 25: Empty slot for LKM */
  104.       LKM_CDEV(),            /* 26: Empty slot for LKM */
  105. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/disksubr.c sys/arch/amiga/amiga/disksubr.c
  106. *** sys.orig/arch/amiga/amiga/disksubr.c    Tue Dec 20 09:33:07 1994
  107. --- sys/arch/amiga/amiga/disksubr.c    Thu Dec 22 21:12:39 1994
  108. ***************
  109. *** 154,158 ****
  110. --- 154,167 ----
  111.        * I also don't trust rdb->secpercyl
  112.        */
  113. + #if 0
  114. +     /*
  115. +      * *DONT* pretend to be smarter than the user who configured the
  116. +      * disk!! If the RDB is wrong, fix the RDB, don't propagate problems
  117. +      * instead of fixing them..
  118. +      */
  119.       lp->d_secpercyl = min(rbp->secpercyl, lp->d_nsectors * lp->d_ntracks);
  120. + #else
  121. +     lp->d_secpercyl = rbp->secpercyl;
  122. + #endif
  123.   #ifdef DIAGNOSTIC
  124.       if (lp->d_ncylinders != rbp->ncylinders)
  125. ***************
  126. *** 259,262 ****
  127. --- 268,289 ----
  128.               }
  129.               break;
  130. +               case ADT_NETBSDUSPEC:
  131. +                           {
  132. +                             int idx = (pbp->e.dostype & 0xff) - 'D';
  133. +                 if (idx < 0 || idx > 5) {
  134. +                                     printf("WARN: BSD%c out of bounds! Ignoring.\n", idx+'D');
  135. +                     clp->rdblock = RDBNULL; /* invalidate cpulab */
  136. +                     continue;
  137. +                 }
  138. +                                   /* skip root, swap and raw partition */
  139. +                 idx += 3;
  140. +                 pp = &lp->d_partitions[idx];
  141. +                 if (pp->p_size) {
  142. +                                     printf("WARN: more than one %c partition,ignoring\n", idx + 'A');
  143. +                     clp->rdblock = RDBNULL; /* invalidate cpulab */
  144. +                     continue;
  145. +                                   }
  146. +                           }
  147. +                           break;
  148.           case ADT_NETBSDUSER:
  149.           case ADT_AMIGADOS:
  150. ***************
  151. *** 493,496 ****
  152. --- 520,524 ----
  153.           return(adt);
  154.       case DOST_XXXBSD:
  155. + #if 0
  156.   #ifdef DIAGNOSTIC
  157.           printf("found dostype: 0x%x which is deprecated", dostype);
  158. ***************
  159. *** 510,513 ****
  160. --- 538,553 ----
  161.   #endif
  162.           return(getadostype(dostype));
  163. + #endif /* 0, don't break something very useful */
  164. +         if (b1 == 'R') {
  165. +                     adt.archtype = ADT_NETBSDROOT;
  166. +             adt.fstype = FS_BSDFFS;
  167. +         } else if (b1 == 'S') {
  168. +                     adt.archtype = ADT_NETBSDSWAP;
  169. +             adt.fstype = FS_SWAP;
  170. +                 } else {
  171. +                     adt.archtype = ADT_NETBSDUSPEC;
  172. +             adt.fstype = FS_BSDFFS;
  173. +                 }
  174. +         return adt;
  175.       default:
  176.   #ifdef DIAGNOSTIC
  177. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/genassym.c sys/arch/amiga/amiga/genassym.c
  178. *** sys.orig/arch/amiga/amiga/genassym.c    Tue Dec 20 09:33:07 1994
  179. --- sys/arch/amiga/amiga/genassym.c    Tue Dec 27 20:14:28 1994
  180. ***************
  181. *** 97,101 ****
  182.       printf("#define\tT_TRACE %d\n", T_TRACE);
  183.       printf("#define\tT_MMUFLT %d\n", T_MMUFLT);
  184. !     printf("#define\tT_SSIR %d\n", T_SSIR);
  185.       printf("#define\tT_FMTERR %d\n", T_FMTERR);
  186.       printf("#define\tT_COPERR %d\n", T_COPERR);
  187. --- 97,101 ----
  188.       printf("#define\tT_TRACE %d\n", T_TRACE);
  189.       printf("#define\tT_MMUFLT %d\n", T_MMUFLT);
  190. ! /*    printf("#define\tT_SSIR %d\n", T_SSIR);*/
  191.       printf("#define\tT_FMTERR %d\n", T_FMTERR);
  192.       printf("#define\tT_COPERR %d\n", T_COPERR);
  193. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/locore.s sys/arch/amiga/amiga/locore.s
  194. *** sys.orig/arch/amiga/amiga/locore.s    Tue Dec 20 09:33:07 1994
  195. --- sys/arch/amiga/amiga/locore.s    Wed Dec 28 18:38:49 1994
  196. ***************
  197. *** 57,60 ****
  198. --- 57,61 ----
  199.   #define INTREQRADDR(ar)    movl    _INTREQRaddr,ar
  200.   #define INTREQWADDR(ar)    movl    _INTREQWaddr,ar
  201. + #define INTENAWADDR(ar) movl    _amiga_intena_write,a0
  202.   
  203.       .text
  204. ***************
  205. *** 510,514 ****
  206.   _lev2intr:
  207.   _lev3intr:
  208. - _lev4intr:
  209.       moveml    #0xC0C0,sp@-
  210.   Lnotdma:
  211. --- 511,514 ----
  212. ***************
  213. *** 526,531 ****
  214. --- 526,558 ----
  215.   
  216.   _lev6intr:
  217. +     /*
  218. +      * cause a level 4 interrupt (AUD3) to occur as soon
  219. +      * as we return. Block generation of level 6 ints until
  220. +      * we have dealt with this one.
  221. +      */
  222. +     movel    a0,sp@-
  223. +     INTREQWADDR(a0)
  224. +     movew    #INTF_SETCLR+INTF_AUD3,a0@
  225. +     INTENAWADDR(a0)
  226. +     movew    #INTF_EXTER,a0@
  227. +     movew    #INTF_SETCLR+INTF_AUD3,a0@    | make sure THIS one is ok...
  228. +     movel    sp@+,a0
  229. +     rte
  230. + _lev4intr:
  231. + _fake_lev6intr:    
  232.       moveml    #0xC0C0,sp@-
  233. +     /*
  234. +      * check for fake level 6
  235. +      */
  236. +     INTREQRADDR(a0)
  237. +     movew    a0@,d0
  238. +     btst    #INTB_EXTER,d0
  239. +     beq    Lnotdma            | if regular level 4, handle normally
  240. +     
  241.   #if NZSSC > 0
  242. +     /*
  243. +      * THIS WILL ALSO HAVE TO CLEAR INTF_AUD3 !!! Mike please fix...
  244. +      */
  245.       jbsr    _siopintr6        | check for siop (53C710) interrupt
  246.       tstl    d0
  247. ***************
  248. *** 535,539 ****
  249.       movb    a0@(CIAICR),d0        | read irc register (clears ints!)
  250.       INTREQWADDR(a0)
  251. !     movew    #INTF_EXTER,a0@        | clear EXTER interrupt in intreq
  252.       btst    #0,d0            | timerA interrupt?
  253.       jeq     Lskipciab        | no
  254. --- 562,568 ----
  255.       movb    a0@(CIAICR),d0        | read irc register (clears ints!)
  256.       INTREQWADDR(a0)
  257. !     movew    #INTF_EXTER+INTF_AUD3,a0@ | clear EXTER | AUD3 in intreq
  258. !     INTENAWADDR(a0)
  259. !     movew    #INTF_SETCLR+INTF_EXTER,a0@ | reenable EXTER interrupts
  260.       btst    #0,d0            | timerA interrupt?
  261.       jeq     Lskipciab        | no
  262. ***************
  263. *** 574,578 ****
  264.    * for bus error frames (type 10 and 11).
  265.    */
  266. -     .comm    _ssir,1
  267.       .globl    _astpending
  268.       .globl    rei
  269. --- 603,606 ----
  270. ***************
  271. *** 583,590 ****
  272.   #endif
  273.       tstl    _astpending        | AST pending?
  274. !     jeq    Lchksir            | no, go check for SIR
  275.   Lrei1:
  276.       btst    #5,sp@            | yes, are we returning to user mode?
  277. !     jne    Lchksir            | no, go check for SIR
  278.       movw    #PSL_LOWIPL,sr        | lower SPL
  279.       clrl    sp@-            | stack adjust
  280. --- 611,618 ----
  281.   #endif
  282.       tstl    _astpending        | AST pending?
  283. !     jeq    Ldorte            | no, done
  284.   Lrei1:
  285.       btst    #5,sp@            | yes, are we returning to user mode?
  286. !     jne    Ldorte            | no, done
  287.       movw    #PSL_LOWIPL,sr        | lower SPL
  288.       clrl    sp@-            | stack adjust
  289. ***************
  290. *** 614,646 ****
  291.       moveml    sp@+,#0x7FFF        | restore user registers
  292.       movl    sp@,sp            | and our SP
  293. -     rte                | and do real RTE
  294. - Lchksir:
  295. -     tstb    _ssir            | SIR pending?
  296. -     jeq    Ldorte            | no, all done
  297. -     movl    d0,sp@-            | need a scratch register
  298. -     movw    sp@(4),d0        | get SR
  299. -     andw    #PSL_IPL7,d0        | mask all but IPL
  300. -     jne    Lnosir            | came from interrupt, no can do
  301. -     movl    sp@+,d0            | restore scratch register
  302. - Lgotsir:
  303. -     movw    #SPL1,sr        | prevent others from servicing int
  304. -     tstb    _ssir            | too late?
  305. -     jeq    Ldorte            | yes, oh well...
  306. -     clrl    sp@-            | stack adjust
  307. -     moveml    #0xFFFF,sp@-        | save all registers
  308. -     movl    usp,a1            | including
  309. -     movl    a1,sp@(FR_SP)        |    the users SP
  310. -     clrl    sp@-            | VA == none
  311. -     clrl    sp@-            | code == none
  312. -     movl    #T_SSIR,sp@-        | type == software interrupt
  313. -     jbsr    _trap            | go handle it
  314. -     lea    sp@(12),sp        | pop value args
  315. -     movl    sp@(FR_SP),a0        | restore
  316. -     movl    a0,usp            |   user SP
  317. -     moveml    sp@+,#0x7FFF        | and all remaining registers
  318. -     addql    #8,sp            | pop SP and stack adjust
  319. -     rte
  320. - Lnosir:
  321. -     movl    sp@+,d0            | restore scratch register
  322.   Ldorte:
  323.       rte                | real return
  324. --- 642,645 ----
  325. ***************
  326. *** 1681,1704 ****
  327.       ploadw    #1,a0@            | pre-load translation
  328.   Lploadw040:            | should 68040 do a ptest?
  329. -     rts
  330. - /*
  331. -  * Set processor priority level calls.  Most are implemented with
  332. -  * inline asm expansions.  However, spl0 requires special handling
  333. -  * as we need to check for our emulated software interrupts.
  334. -  */
  335. - ENTRY(spl0)
  336. -     moveq    #0,d0
  337. -     movw    sr,d0            | get old SR for return
  338. -     movw    #PSL_LOWIPL,sr        | restore new SR
  339. -     tstb    _ssir            | software interrupt pending?
  340. -     jeq    Lspldone        | no, all done
  341. -     subql    #4,sp            | make room for RTE frame
  342. -     movl    sp@(4),sp@(2)        | position return address
  343. -     clrw    sp@(6)            | set frame type 0
  344. -     movw    #PSL_LOWIPL,sp@        | and new SR
  345. -     jra    Lgotsir            | go handle it
  346. - Lspldone:
  347.       rts
  348.   
  349. --- 1680,1683 ----
  350. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/machdep.c sys/arch/amiga/amiga/machdep.c
  351. *** sys.orig/arch/amiga/amiga/machdep.c    Tue Dec 20 09:33:08 1994
  352. --- sys/arch/amiga/amiga/machdep.c    Wed Dec 28 23:04:22 1994
  353. ***************
  354. *** 136,139 ****
  355. --- 136,145 ----
  356.   int    physmem = MAXMEM;    /* max supported memory, changes to actual */
  357.   /*
  358. +  * extender "register" for software interrupts. Moved here 
  359. +  * from locore.s, since softints are no longer dealt with
  360. +  * in locore.s.
  361. +  */
  362. + unsigned char ssir;
  363. + /*
  364.    * safepri is a safe priority for sleep to set for a spin-wait
  365.    * during autoconfiguration or after a panic.
  366. ***************
  367. *** 1060,1064 ****
  368.       if ((howto&RB_NOSYNC) == 0)
  369.           bootsync();
  370. !     splhigh();            /* extreme priority */
  371.       if (howto&RB_HALT) {
  372.           printf("halted\n\n");
  373. --- 1066,1070 ----
  374.       if ((howto&RB_NOSYNC) == 0)
  375.           bootsync();
  376. !     spl7();            /* extreme priority */
  377.       if (howto&RB_HALT) {
  378.           printf("halted\n\n");
  379. ***************
  380. *** 1299,1311 ****
  381.   
  382.       /*
  383. -      * make sure we have software ints enabled at all..
  384. -      */
  385. -     custom.intena = INTF_SETCLR | INTF_SOFTINT;
  386. -     /*
  387.        * and cause a software interrupt (spl1). This interrupt might
  388.        * happen immediately, or after returning to a safe enough level.
  389.        */
  390. !     custom.intreq = INTF_SETCLR | INTF_SOFTINT;
  391.   }
  392.   
  393. --- 1305,1312 ----
  394.   
  395.       /*
  396.        * and cause a software interrupt (spl1). This interrupt might
  397.        * happen immediately, or after returning to a safe enough level.
  398.        */
  399. !     setsoftcback();
  400.   }
  401.   
  402. ***************
  403. *** 1384,1394 ****
  404.               /*
  405.                * first clear the softint-bit
  406. !              * then call installed callbacks, 
  407.                * this order is dicated by the nature of 
  408.                * software interrupts.  The other order
  409.                * allows software interrupts to be missed
  410.                */
  411. !             custom.intreq = INTF_SOFTINT;
  412. !             call_sicallbacks();
  413.           }
  414.           break;
  415. --- 1385,1410 ----
  416.               /*
  417.                * first clear the softint-bit
  418. !              * then process all classes of softints.
  419.                * this order is dicated by the nature of 
  420.                * software interrupts.  The other order
  421.                * allows software interrupts to be missed
  422.                */
  423. !             clrsoftint();
  424. !             if (ssir & SIR_NET) {
  425. !                 siroff(SIR_NET);
  426. !                 cnt.v_soft++;
  427. !                 netintr();
  428. !             }
  429. !             if (ssir & SIR_CLOCK) {
  430. !                 siroff(SIR_CLOCK);
  431. !                 cnt.v_soft++;
  432. !                 /* XXXX softclock(&frame.f_stackadj); */
  433. !                 softclock();
  434. !             }
  435. !             if (ssir & SIR_CBACK) {
  436. !                 siroff(SIR_CBACK);
  437. !                 cnt.v_soft++;
  438. !                 call_sicallbacks();
  439. !             }
  440.           }
  441.           break;
  442. ***************
  443. *** 1454,1462 ****
  444.       case 3: 
  445.         /* VBL */
  446. !         if (custom.intreqr& INTF_BLIT)  
  447.               blitter_handler();
  448. !         if (custom.intreqr & INTF_COPER)  
  449.               copper_handler();
  450. !         if (custom.intreqr & INTF_VERTB) 
  451.               vbl_handler();
  452.           break;
  453. --- 1470,1478 ----
  454.       case 3: 
  455.         /* VBL */
  456. !         if (ireq & INTF_BLIT)  
  457.               blitter_handler();
  458. !         if (ireq & INTF_COPER)  
  459.               copper_handler();
  460. !         if (ireq & INTF_VERTB) 
  461.               vbl_handler();
  462.           break;
  463. ***************
  464. *** 1547,1551 ****
  465.       if (doingdump)
  466.           return;
  467. !     s = splhigh();
  468.       doingdump = 1;
  469.       printf("pid = %d, pc = %s, ", curproc->p_pid, hexstr(fp->f_pc, 8));
  470. --- 1563,1567 ----
  471.       if (doingdump)
  472.           return;
  473. !     s = spl7();
  474.       doingdump = 1;
  475.       printf("pid = %d, pc = %s, ", curproc->p_pid, hexstr(fp->f_pc, 8));
  476. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/swapgeneric.c sys/arch/amiga/amiga/swapgeneric.c
  477. *** sys.orig/arch/amiga/amiga/swapgeneric.c    Tue Dec 20 09:33:08 1994
  478. --- sys/arch/amiga/amiga/swapgeneric.c    Sun Dec 25 03:49:38 1994
  479. ***************
  480. *** 125,128 ****
  481. --- 125,134 ----
  482.           }
  483.           cp = bp + 2;
  484. +         if (cp[1] && (cp[1] < 'a' || cp[1] > 'h'))
  485. +           {
  486. +             printf ("bad partition, valid are %sa to %sh\n",
  487. +                 gc->gc_driver->cd_name, gc->gc_driver->cd_name);
  488. +             continue;
  489. +           }
  490.           if (*cp >= '0' && *cp <= '9')
  491.               break;
  492. ***************
  493. *** 138,142 ****
  494.       struct genericconf *gc;
  495.       struct bdevsw *bdp;
  496. !     int unit, swaponroot;
  497.       char name[128];
  498.       char *cp;
  499. --- 144,148 ----
  500.       struct genericconf *gc;
  501.       struct bdevsw *bdp;
  502. !     int unit, part, swaponroot;
  503.       char name[128];
  504.       char *cp;
  505. ***************
  506. *** 148,151 ****
  507. --- 154,158 ----
  508.   
  509.       unit = 0;
  510. +     part = 0;
  511.       if (boothowto & RB_ASKNAME) {
  512.           gc = getgenconf(name);
  513. ***************
  514. *** 153,156 ****
  515. --- 160,165 ----
  516.           while (*cp >= '0' && *cp <= '9')
  517.               unit = 10 * unit + *cp++ - '0';
  518. +         if (*cp >= 'a' && *cp <= 'h')
  519. +               part = *cp++ - 'a';
  520.           if (*cp == '*')
  521.               swaponroot = 1;
  522. ***************
  523. *** 191,195 ****
  524.   found:
  525.   
  526. !     gc->gc_root = MAKEDISKDEV(major(gc->gc_root), unit, 0);
  527.       rootdev = gc->gc_root;
  528.   
  529. --- 200,204 ----
  530.   found:
  531.   
  532. !     gc->gc_root = MAKEDISKDEV(major(gc->gc_root), unit, part);
  533.       rootdev = gc->gc_root;
  534.   
  535. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/trap.c sys/arch/amiga/amiga/trap.c
  536. *** sys.orig/arch/amiga/amiga/trap.c    Tue Dec 20 09:33:08 1994
  537. --- sys/arch/amiga/amiga/trap.c    Tue Dec 27 19:31:46 1994
  538. ***************
  539. *** 617,653 ****
  540.       case T_ASTFLT|T_USER:
  541.           astpending = 0;
  542. -         /*
  543. -          * We check for software interrupts first.  This is because
  544. -          * they are at a higher level than ASTs, and on a VAX would
  545. -          * interrupt the AST.  We assume that if we are processing
  546. -          * an AST that we must be at IPL0 so we don't bother to
  547. -          * check.  Note that we ensure that we are at least at SIR
  548. -          * IPL while processing the SIR.
  549. -          */
  550. -         spl1();
  551. -         /*FALLTHROUGH*/
  552. -     /*
  553. -      * Software interrupt
  554. -      */
  555. -     case T_SSIR:
  556. -     case T_SSIR|T_USER:
  557. -         if (ssir & SIR_NET) {
  558. -             siroff(SIR_NET);
  559. -             cnt.v_soft++;
  560. -             netintr();
  561. -         }
  562. -         if (ssir & SIR_CLOCK) {
  563. -             siroff(SIR_CLOCK);
  564. -             cnt.v_soft++;
  565. -             /* XXXX softclock(&frame.f_stackadj); */
  566. -             softclock();
  567. -         }
  568. -         /*
  569. -          * If this was not an AST trap, we are all done.
  570. -          */
  571. -         if (type != (T_ASTFLT|T_USER)) {
  572. -             cnt.v_trap--;
  573. -             return;
  574. -         }
  575.           spl0();
  576.           if (p->p_flag & P_OWEUPC) {
  577. --- 617,620 ----
  578. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/conf/Makefile.amiga sys/arch/amiga/conf/Makefile.amiga
  579. *** sys.orig/arch/amiga/conf/Makefile.amiga    Tue Dec 20 09:33:15 1994
  580. --- sys/arch/amiga/conf/Makefile.amiga    Tue Dec 27 15:24:51 1994
  581. ***************
  582. *** 35,39 ****
  583.   
  584.   INCLUDES= -I. -I$S/arch -I$S -I$S/sys 
  585. ! COPTS=    ${INCLUDES} ${IDENT} -DKERNEL -Dmc68020 -Damiga
  586.   CFLAGS=    -O -mc68020 -m68881 ${COPTS}
  587.   
  588. --- 35,39 ----
  589.   
  590.   INCLUDES= -I. -I$S/arch -I$S -I$S/sys 
  591. ! COPTS=    ${INCLUDES} ${IDENT} -DKERNEL -Dmc68020 -Damiga -Dm68k
  592.   CFLAGS=    -O -mc68020 -m68881 ${COPTS}
  593.   
  594. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/grf.c sys/arch/amiga/dev/grf.c
  595. *** sys.orig/arch/amiga/dev/grf.c    Tue Dec 20 09:33:16 1994
  596. --- sys/arch/amiga/dev/grf.c    Sun Dec 25 09:08:11 1994
  597. ***************
  598. *** 253,257 ****
  599.       case GRFSETVMODE:
  600.           error = gp->g_mode(gp, GM_GRFSETVMODE, data);
  601. !         if (error == 0 && gp->g_itedev)
  602.               ite_reinit(gp->g_itedev);
  603.           break;
  604. --- 253,257 ----
  605.       case GRFSETVMODE:
  606.           error = gp->g_mode(gp, GM_GRFSETVMODE, data);
  607. !         if (error == 0 && gp->g_itedev && !(gp->g_flags & GF_GRFON)) 
  608.               ite_reinit(gp->g_itedev);
  609.           break;
  610. ***************
  611. *** 269,272 ****
  612. --- 269,273 ----
  613.       case GRFIOCGSPRITEINF:
  614.       case GRFIOCGSPRITEMAX:
  615. +     case GRFIOCBITBLT:
  616.           return(gp->g_mode(gp, GM_GRFIOCTL, cmd, data));
  617.       default:
  618. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/grf_rh.c sys/arch/amiga/dev/grf_rh.c
  619. *** sys.orig/arch/amiga/dev/grf_rh.c    Tue Dec 20 09:33:17 1994
  620. --- sys/arch/amiga/dev/grf_rh.c    Sun Dec 25 09:27:02 1994
  621. ***************
  622. *** 21,24 ****
  623. --- 21,26 ----
  624.   #include <amiga/dev/zthreebusvar.h>
  625.   
  626. + enum mode_type { MT_TXTONLY, MT_GFXONLY, MT_BOTH };
  627.   int rh_mondefok __P((struct MonDef *));
  628.   
  629. ***************
  630. *** 26,30 ****
  631.   int rh_load_mon __P((struct grf_softc *gp, struct MonDef *md));
  632.   int rh_getvmode __P((struct grf_softc *gp, struct grfvideo_mode *vm));
  633. ! int rh_setvmode __P((struct grf_softc *gp, unsigned int mode, int txtonly));
  634.   
  635.   
  636. --- 28,33 ----
  637.   int rh_load_mon __P((struct grf_softc *gp, struct MonDef *md));
  638.   int rh_getvmode __P((struct grf_softc *gp, struct grfvideo_mode *vm));
  639. ! int rh_setvmode __P((struct grf_softc *gp, unsigned int mode, 
  640. !              enum mode_type type));
  641.   
  642.   
  643. ***************
  644. *** 38,41 ****
  645. --- 41,54 ----
  646.   #endif
  647.   
  648. + /* make it patchable, and settable by kernel config option */
  649. + #ifndef RH_MEMCLK
  650. + #define RH_MEMCLK 61000000  /* this is the memory clock value, you shouldn't
  651. +                                set it to less than 61000000, higher values may
  652. +                                speed up blits a little bit, if you raise this
  653. +                                value too much, some trash will appear on your
  654. +                                screen. */
  655. + #endif
  656. + int rh_memclk = RH_MEMCLK;
  657.   
  658.   /*
  659. ***************
  660. *** 74,77 ****
  661. --- 87,92 ----
  662.   #define MDF_CLKDIV2 4
  663.   
  664. + /* set this as an option in your kernel config file! */
  665. + /* #define RZ3_64BIT_SPRITE */
  666.   
  667.   /* -------------- START OF CODE -------------- */
  668. ***************
  669. *** 124,128 ****
  670. --- 139,147 ----
  671.       const unsigned long *s = data;
  672.       struct MonDef *MonitorDef = (struct MonDef *) gp->g_data;
  673. + #ifdef RZ3_64BIT_SPRITE
  674.       short x = (HWC_MEM_SIZE / (4*4)) - 1;
  675. + #else
  676. +         short x = (HWC_MEM_SIZE / (4*4*2)) - 1;
  677. + #endif
  678.       /* copy only, if there is a data pointer. */
  679.       if (data) do {
  680. ***************
  681. *** 135,142 ****
  682.       WSeq(ba, SEQ_ID_CURSOR_COLOR1, col1);
  683.       WSeq(ba, SEQ_ID_CURSOR_COLOR0, col2);
  684. !     if (MonitorDef->DEP < 16)
  685. !         WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0x85);
  686. !     else
  687. !         WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0xa5);
  688.       WSeq(ba, SEQ_ID_CURSOR_X_LOC_HI, 0x00);
  689.       WSeq(ba, SEQ_ID_CURSOR_X_LOC_LO, 0x00);
  690. --- 154,178 ----
  691.       WSeq(ba, SEQ_ID_CURSOR_COLOR1, col1);
  692.       WSeq(ba, SEQ_ID_CURSOR_COLOR0, col2);
  693. !     if (MonitorDef->DEP <= 8) {
  694. ! #ifdef RZ3_64BIT_SPRITE
  695. !                 WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0x85);
  696. ! #else
  697. !                 WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0x03);
  698. ! #endif
  699. !         }
  700. !         else if (MonitorDef->DEP <= 16) {
  701. ! #ifdef RZ3_64BIT_SPRITE
  702. !                 WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0xa5);
  703. ! #else
  704. !                 WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0x23);
  705. ! #endif
  706. !         }
  707. !         else {
  708. ! #ifdef RZ3_64BIT_SPRITE
  709. !                 WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0xc5);
  710. ! #else
  711. !                 WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0x43);
  712. ! #endif
  713. !         }
  714.       WSeq(ba, SEQ_ID_CURSOR_X_LOC_HI, 0x00);
  715.       WSeq(ba, SEQ_ID_CURSOR_X_LOC_LO, 0x00);
  716. ***************
  717. *** 391,394 ****
  718. --- 427,515 ----
  719.   }
  720.   
  721. + void 
  722. + RZ3BitBlit24 (gp, gbb)
  723. +      struct grf_softc *gp;
  724. +      struct grf_bitblt * gbb;
  725. + {
  726. +     volatile unsigned char *ba = gp->g_regkva;
  727. +     volatile unsigned char *lm = ba + LM_OFFSET;
  728. +     volatile unsigned long * acm = (unsigned long *) (ba + ACM_OFFSET);
  729. +     const struct MonDef * md = (struct MonDef *) gp->g_data;
  730. +     unsigned short mod;
  731. +     { 
  732. +         unsigned long * pt = (unsigned long *) (lm + PAT_MEM_OFF);
  733. +         unsigned long tmp  = gbb->mask | ((unsigned long)gbb->mask << 16);
  734. +         *pt++ = tmp;
  735. +         *pt++ = tmp;
  736. +         *pt++ = tmp;
  737. +         *pt++ = tmp;
  738. +         *pt++ = tmp;
  739. +         *pt   = tmp;
  740. +     }
  741. +     
  742. +     {
  743. +         
  744. +         unsigned long tmp = optab[ gbb->op ] << 8;
  745. +         *(acm + ACM_RASTEROP_ROTATION/4) = tmp;
  746. +     }
  747. +     
  748. +     mod = 0xc0c2;
  749. +     
  750. +     {
  751. +         unsigned long pat = 8 * PAT_MEM_OFF;
  752. +         unsigned long dst = 8 * 3 * (gbb->dst_x + gbb->dst_y * md->TX);
  753. +         
  754. +         if (optabs[gbb->op]) {
  755. +             unsigned long src = 8 * 3 * (gbb->src_x + gbb->src_y * md->TX);
  756. +             
  757. +             if (gbb->dst_x > gbb->src_x ) {
  758. +                 mod &= ~0x8000;
  759. +                 src += 8 * 3 * (gbb->w);
  760. +                 dst += 8 * 3 * (gbb->w);
  761. +                 pat += 8 * 3 * 2;
  762. +             }
  763. +             if (gbb->dst_y > gbb->src_y) {
  764. +                 mod &= ~0x4000;
  765. +                 src += 8 * 3 * (gbb->h - 1) * md->TX;
  766. +                 dst += 8 * 3 * (gbb->h - 1) * md->TX;
  767. +                 pat += 8 * 4 * 3;
  768. +             }
  769. +             
  770. +             M2I(src);
  771. +             *(acm + ACM_SOURCE/4) = src;
  772. +         }
  773. +         
  774. +         
  775. +         M2I(pat);
  776. +         *(acm + ACM_PATTERN/4) = pat;
  777. +         
  778. +         
  779. +         M2I(dst);
  780. +         *(acm + ACM_DESTINATION/4) = dst;
  781. +     }
  782. +     {
  783. +         
  784. +         unsigned long tmp = mod << 16;
  785. +         *(acm + ACM_CONTROL/4) = tmp;
  786. +     }
  787. +     {
  788. +         
  789. +         unsigned long tmp  = gbb->w | (gbb->h << 16);
  790. +         M2I(tmp);
  791. +         *(acm + ACM_BITMAP_DIMENSION/4) = tmp;
  792. +     }
  793. +     
  794. +     
  795. +     *(((volatile unsigned char *)acm) + ACM_START_STATUS) = 0x00; 
  796. +     *(((volatile unsigned char *)acm) + ACM_START_STATUS) = 0x01; 
  797. +     
  798. +     while ( (*(((volatile unsigned char *)acm) 
  799. +            + (ACM_START_STATUS+ 2)) & 1) == 0 ) {};
  800. +     
  801. + }
  802.   void
  803.   RZ3SetCursorPos (gp, pos)
  804. ***************
  805. *** 465,489 ****
  806.   
  807.   
  808. !     if (md->DEP > 8)
  809. !         xoff *= 2;
  810.   
  811.       vgar(ba, ACT_ADDRESS_RESET);
  812.       WAttr(ba, ACT_ID_HOR_PEL_PANNING, (unsigned char)((xoff << 1) & 0x07));
  813.       /* have the color lookup function normally again */
  814.       vgaw(ba,  ACT_ADDRESS_W, 0x20);
  815.   
  816. !     if (md->DEP == 8)
  817. !         off = ((yoff * md->TX)/ 4) + (xoff >> 2);
  818. !     else
  819. !         off = ((yoff * md->TX * 2)/ 4) + (xoff >> 2);
  820. !     WCrt(ba, CRT_ID_START_ADDR_LOW, ((unsigned char)off));
  821.       off >>= 8;
  822.       WCrt(ba, CRT_ID_START_ADDR_HIGH, ((unsigned char)off));
  823.       off >>= 8;
  824.       WCrt(ba, CRT_ID_EXT_START_ADDR,
  825.           ((RCrt(ba, CRT_ID_EXT_START_ADDR) & 0xf0) | (off & 0x0f)));
  826. --- 586,608 ----
  827.   
  828.   
  829. !     if (md->DEP > 8 && md->DEP <= 16) xoff *= 2;
  830. !     else if (md->DEP > 16) xoff *= 3;
  831.   
  832.       vgar(ba, ACT_ADDRESS_RESET);
  833.       WAttr(ba, ACT_ID_HOR_PEL_PANNING, (unsigned char)((xoff << 1) & 0x07));
  834.       /* have the color lookup function normally again */
  835.       vgaw(ba,  ACT_ADDRESS_W, 0x20);
  836.   
  837. !     if (md->DEP == 8) 
  838. !           off = ((yoff * md->TX)/ 4) + (xoff >> 2);
  839. !     else if (md->DEP == 16) 
  840. !           off = ((yoff * md->TX * 2)/ 4) + (xoff >> 2);
  841. !     else 
  842. !         off = ((yoff * md->TX * 3)/ 4) + (xoff >> 2);
  843. !     WCrt(ba, CRT_ID_START_ADDR_LOW, ((unsigned char)off));      
  844.       off >>= 8;
  845.       WCrt(ba, CRT_ID_START_ADDR_HIGH, ((unsigned char)off));
  846.       off >>= 8;
  847.       WCrt(ba, CRT_ID_EXT_START_ADDR,
  848.           ((RCrt(ba, CRT_ID_EXT_START_ADDR) & 0xf0) | (off & 0x0f)));
  849. ***************
  850. *** 583,586 ****
  851. --- 702,706 ----
  852.       case 8:
  853.       case 16:
  854. +     case 24:
  855.           return(1);
  856.       case 4:
  857. ***************
  858. *** 685,694 ****
  859.       }
  860.   
  861. !     if (md->DEP == 4)
  862. !         HDE = (md->MW+md->FX-1)/md->FX;
  863. !     else if (md->DEP == 8)
  864. !         HDE = (md->MW+3)/4;
  865. !     else if (md->DEP == 16)
  866. !         HDE = (md->MW*2+3)/4;
  867.   
  868.       VDE = md->MH-1;
  869. --- 805,812 ----
  870.       }
  871.   
  872. !     if      (md->DEP == 4)  HDE = (md->MW+md->FX-1)/md->FX;
  873. !     else if (md->DEP == 8)  HDE = (md->MW+3)/4;
  874. !     else if (md->DEP == 16) HDE = (md->MW*2+3)/4;
  875. !     else if (md->DEP == 24) HDE = (md->MW*3+3)/4;
  876.   
  877.       VDE = md->MH-1;
  878. ***************
  879. *** 722,732 ****
  880.       if (md->DEP == 4) {
  881.             /* 8bit pixel, no gfx byte path */
  882. !         WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x00);
  883. !     } else if (md->DEP == 8) {
  884.             /* 8bit pixel, gfx byte path */
  885. !         WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x01);
  886. !     } else if (md->DEP == 16) {
  887.             /* 16bit pixel, gfx byte path */
  888. !         WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x11);
  889.       }
  890.       WSeq(ba, SEQ_ID_BUS_WIDTH_FEEDB, 0x04);
  891. --- 840,856 ----
  892.       if (md->DEP == 4) {
  893.             /* 8bit pixel, no gfx byte path */
  894. !         WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x00);  
  895. !     }
  896. !     else if (md->DEP == 8) {
  897.             /* 8bit pixel, gfx byte path */
  898. !         WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x01);  
  899. !     }
  900. !     else if (md->DEP == 16) {
  901.             /* 16bit pixel, gfx byte path */
  902. !         WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x11);  
  903. !     }
  904. !     else if (md->DEP == 24) {
  905. !           /* 24bit pixel, gfx byte path */
  906. !         WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x21);  
  907.       }
  908.       WSeq(ba, SEQ_ID_BUS_WIDTH_FEEDB, 0x04);
  909. ***************
  910. *** 801,810 ****
  911.       WCrt(ba, CRT_ID_VER_DISP_ENA_END, VDE  & 0xff);
  912.   
  913. !     if (md->DEP == 4)
  914. !         WCrt(ba, CRT_ID_OFFSET, (HDE / 2) & 0xff);
  915. !     else if (md->DEP == 8)
  916. !         WCrt(ba, CRT_ID_OFFSET, (md->TX / 8) & 0xff);
  917. !     else
  918. !         WCrt(ba, CRT_ID_OFFSET, (md->TX / 4) & 0xff);
  919.   
  920.       WCrt(ba, CRT_ID_UNDERLINE_LOC, (md->FY-1) & 0x1f);
  921. --- 925,939 ----
  922.       WCrt(ba, CRT_ID_VER_DISP_ENA_END, VDE  & 0xff);
  923.   
  924. !     if (md->DEP == 4) {
  925. !         WCrt(ba, CRT_ID_OFFSET, (HDE / 2) & 0xff );       
  926. !     }
  927. !     /* all gfx-modes are in byte-mode, means values are multiplied by 8 */
  928. !     else if (md->DEP == 8) {
  929. !         WCrt(ba, CRT_ID_OFFSET, (md->TX / 8) & 0xff );       
  930. !     } else if (md->DEP == 16) {
  931. !         WCrt(ba, CRT_ID_OFFSET, (md->TX / 4) & 0xff );       
  932. !     } else {
  933. !         WCrt(ba, CRT_ID_OFFSET, (md->TX * 3 / 8) & 0xff );       
  934. !     }
  935.   
  936.       WCrt(ba, CRT_ID_UNDERLINE_LOC, (md->FY-1) & 0x1f);
  937. ***************
  938. *** 822,834 ****
  939.               ((md->HSS & 0x100) / 0x100 * 8));
  940.   
  941. !     if (md->DEP == 4)
  942. !         WCrt(ba, CRT_ID_EXT_START_ADDR,
  943. !             (((HDE / 2) & 0x100)/0x100 * 16));
  944. !     else if (md->DEP == 8)
  945. !         WCrt(ba, CRT_ID_EXT_START_ADDR,
  946. !             (((md->TX / 8) & 0x100)/0x100 * 16));
  947. !     else
  948. !         WCrt(ba, CRT_ID_EXT_START_ADDR,
  949. !             (((md->TX / 4) & 0x100)/0x100 * 16));
  950.   
  951.       WCrt(ba, CRT_ID_EXT_HOR_TIMING2,
  952. --- 951,964 ----
  953.               ((md->HSS & 0x100) / 0x100 * 8));
  954.   
  955. !     if (md->DEP == 4) {
  956. !         WCrt(ba, CRT_ID_EXT_START_ADDR, (((HDE / 2) & 0x100)/0x100 * 16)); 
  957. !     }
  958. !     else if (md->DEP == 8) {
  959. !         WCrt(ba, CRT_ID_EXT_START_ADDR, (((md->TX / 8) & 0x100)/0x100 * 16)); 
  960. !     } else if (md->DEP == 16) {
  961. !         WCrt(ba, CRT_ID_EXT_START_ADDR, (((md->TX / 4) & 0x100)/0x100 * 16)); 
  962. !     } else {
  963. !         WCrt(ba, CRT_ID_EXT_START_ADDR, (((md->TX * 3 / 8) & 0x100)/0x100 * 16)); 
  964. !     }
  965.   
  966.       WCrt(ba, CRT_ID_EXT_HOR_TIMING2,
  967. ***************
  968. *** 853,857 ****
  969.           unsigned short tmp = CompFQ(md->FQ);
  970.           WPLL(ba, 2   , tmp);
  971. !         tmp = CompFQ(MEMCLK);
  972.           WPLL(ba,10   , tmp);
  973.           WPLL(ba,14   , 0x22);
  974. --- 983,987 ----
  975.           unsigned short tmp = CompFQ(md->FQ);
  976.           WPLL(ba, 2   , tmp);
  977. !         tmp = CompFQ(rh_memclk);
  978.           WPLL(ba,10   , tmp);
  979.           WPLL(ba,14   , 0x22);
  980. ***************
  981. *** 904,913 ****
  982.   
  983.       vgaw(ba, VDAC_MASK, 0xff);
  984. !     if (md->DEP < 16)
  985. !           /* well... probably the PLL chip */
  986. !         vgaw(ba, 0x83c6, ((0 & 7) << 5));
  987. !     else if (md->DEP == 16)
  988.             /* well... */
  989. !         vgaw(ba, 0x83c6, ((3 & 7) << 5));
  990.       vgaw(ba, VDAC_ADDRESS_W, 0x00);
  991.   
  992. --- 1034,1049 ----
  993.   
  994.       vgaw(ba, VDAC_MASK, 0xff);
  995. !     /* probably some PLL timing stuff here. The value
  996. !        for 24bit was found by trial&error :-) */
  997. !     if (md->DEP < 16) {
  998. !         vgaw(ba, 0x83c6, ((0 & 7) << 5) ); 
  999. !     }
  1000. !     else if (md->DEP == 16) {
  1001.             /* well... */
  1002. !         vgaw(ba, 0x83c6, ((3 & 7) << 5) ); 
  1003. !     }
  1004. !     else if (md->DEP == 24) {
  1005. !         vgaw(ba, 0x83c6, 0xe0);
  1006. !     }
  1007.       vgaw(ba, VDAC_ADDRESS_W, 0x00);
  1008.   
  1009. ***************
  1010. *** 1014,1017 ****
  1011. --- 1150,1169 ----
  1012.   
  1013.           return(1);
  1014. +     } else if (md->DEP == 24) {
  1015. +         struct grf_bitblt bb = {
  1016. +             GRFBBOPset,
  1017. +             0, 0,
  1018. +             0, 0,
  1019. +             md->TX, md->TY,
  1020. +             0x0000
  1021. +         };
  1022. +         WSeq(ba, SEQ_ID_MAP_MASK, 0x0f );  
  1023. +         
  1024. +         RZ3BitBlit24(gp, &bb );
  1025. +         
  1026. +         xpan = 0;
  1027. +         ypan = 0;
  1028. +         
  1029. +         return 1;
  1030.       } else
  1031.           return(0);
  1032. ***************
  1033. *** 1068,1145 ****
  1034.    * Depth,          PAL, TX,  TY,    XY,FontX, FontY,    FontData,  FLo,  Fhi
  1035.    */
  1036.   static struct MonDef monitor_defs[] = {
  1037.     /* Text-mode definitions */
  1038.   
  1039.     /* horizontal 31.5 kHz */
  1040. - #ifdef KFONT_8X11
  1041. -   { 50000000,  28,  640, 506,   81, 86, 93, 98, 95, 513, 513, 521, 535, 535,
  1042. -       4, RZ3StdPalette, 80,  46,  3680,    8,    11, kernel_font_8x11, 32,  255},
  1043. - #else
  1044.     { 50000000,  28,  640, 512,   81, 86, 93, 98, 95, 513, 513, 521, 535, 535,
  1045. !       4, RZ3StdPalette, 80,  64,  5120,    8,     8, kernel_font_8x8,   32,  255},
  1046. ! #endif
  1047.   
  1048.     /* horizontal 38kHz */
  1049. - #ifdef KFONT_8X11
  1050. -   { 75000000,  28,  768, 594,   97, 99,107,120,117, 601, 615, 625, 638, 638,
  1051. -       4, RZ3StdPalette, 96,  54,  5184,    8,     11, kernel_font_8x11,   32,  255},
  1052. - #else
  1053.     { 75000000,  28,  768, 600,   97, 99,107,120,117, 601, 615, 625, 638, 638,
  1054. !       4, RZ3StdPalette, 96,  75,  7200,    8,     8, kernel_font_8x8,   32,  255},
  1055. ! #endif
  1056.   
  1057.     /* horizontal 64kHz */
  1058. - #ifdef KFONT_8X11
  1059. -   { 50000000, 24,  768, 594,   97,104,112,122,119, 601, 606, 616, 628, 628,
  1060. -       4, RZ3StdPalette, 96,  54,  5184,    8,     8, kernel_font_8x8,   32,  255},
  1061. - #else
  1062.     { 50000000, 24,  768, 600,   97,104,112,122,119, 601, 606, 616, 628, 628,
  1063. !       4, RZ3StdPalette, 96,  75,  7200,    8,     8, kernel_font_8x8,   32,  255},
  1064. ! #endif
  1065.   
  1066.     /* 8-bit gfx-mode definitions */
  1067.   
  1068. !   /*
  1069. !    * IMPORTANT: the "logical" screen size can be up to 2048x2048 pixels,
  1070. !    * independent from the "physical" screen size. If your code does NOT
  1071. !    * support panning, please adjust the "logical" screen sizes below to
  1072. !    * match the physical ones
  1073. !    */
  1074.   
  1075.     /* 640 x 480, 8 Bit, 31862 Hz, 63 Hz */
  1076.     { 26000000,  0,  640, 480,  161,175,188,200,199, 481, 483, 491, 502, 502,
  1077. !       8, RZ3StdPalette,1280,1024,  5120,    8,     8, kernel_font_8x8,   32,  255},
  1078.     /* This is the logical ^    ^    screen size */
  1079.   
  1080.     /* 640 x 480, 8 Bit, 38366 Hz, 76 Hz */
  1081.    { 31000000,  0,  640, 480,  161,169,182,198,197, 481, 482, 490, 502, 502,
  1082. !      8, RZ3StdPalette,1280,1024,  5120,    8,     8, kernel_font_8x8,   32,  255},
  1083.   
  1084. -   /* 800 x 600, 8 Bit, 31620 Hz, 50 Hz (1950) */
  1085. -   { 32000000,  0,  800, 600,  201,202,218,249,248, 601, 602, 612, 628, 628,
  1086. -       8, RZ3StdPalette,1280,1024,  5120,    8,     8, kernel_font_8x8,   32,  255},
  1087.     /* 800 x 600, 8 Bit, 38537 Hz, 61 Hz */
  1088.     { 39000000,  0,  800, 600,  201,211,227,249,248, 601, 603, 613, 628, 628,
  1089. !       8, RZ3StdPalette,1280,1024,  5120,    8,     8, kernel_font_8x8,   32,  255},
  1090.   
  1091.     /* 1024 x 768, 8 Bit, 63862 Hz, 79 Hz */
  1092.     { 82000000,  0, 1024, 768,  257,257,277,317,316, 769, 771, 784, 804, 804,
  1093. !       8, RZ3StdPalette,1280,1024,  5120,    8,     8, kernel_font_8x8,   32,  255},
  1094.   
  1095.     /* 1120 x 896, 8 Bit, 64000 Hz, 69 Hz */
  1096.     { 97000000,  0, 1120, 896,  281,283,306,369,368, 897, 898, 913, 938, 938,
  1097. !       8, RZ3StdPalette,1280,1024,  5120,    8,     8, kernel_font_8x8,   32,  255},
  1098.   
  1099.     /* 1152 x 910, 8 Bit, 76177 Hz, 79 Hz */
  1100.     {110000000,  0, 1152, 910,  289,310,333,357,356, 911, 923, 938, 953, 953,
  1101. !       8, RZ3StdPalette,1280,1024,  5120,    8,     8, kernel_font_8x8,   32,  255},
  1102.   
  1103.     /* 1184 x 848, 8 Bit, 73529 Hz, 82 Hz */
  1104.     {110000000,  0, 1184, 848,  297,319,342,370,369, 849, 852, 866, 888, 888,
  1105. !       8, RZ3StdPalette,1280,1024,  5120,    8,     8, kernel_font_8x8,   32,  255},
  1106.   
  1107.     /* 1280 x 1024, 8 Bit, 64516 Hz, 60 Hz */
  1108.     {104000000, 0, 1280,1024,  321,323,348,399,398,1025,1026,1043,1073,1073,
  1109. !      8, RZ3StdPalette,1280,1024,  5120,    8,     8, kernel_font_8x8,   32,  255},
  1110.   
  1111.   /* WARNING: THE FOLLOWING MONITOR MODE EXCEEDS THE 110-MHz LIMIT THE PROCESSOR
  1112. --- 1220,1289 ----
  1113.    * Depth,          PAL, TX,  TY,    XY,FontX, FontY,    FontData,  FLo,  Fhi
  1114.    */
  1115. + #ifdef KFONT_8X11
  1116. + #define KERNEL_FONT kernel_font_8x11
  1117. + #define FY 11
  1118. + #define FX  8
  1119. + #else
  1120. + #define KERNEL_FONT kernel_font_8x8
  1121. + #define FY  8
  1122. + #define FX  8
  1123. + #endif
  1124.   static struct MonDef monitor_defs[] = {
  1125.     /* Text-mode definitions */
  1126.   
  1127.     /* horizontal 31.5 kHz */
  1128.     { 50000000,  28,  640, 512,   81, 86, 93, 98, 95, 513, 513, 521, 535, 535,
  1129. !       4, RZ3StdPalette, 80,  64,  5120,   FX,    FY, KERNEL_FONT,   32,  255},
  1130.   
  1131.     /* horizontal 38kHz */
  1132.     { 75000000,  28,  768, 600,   97, 99,107,120,117, 601, 615, 625, 638, 638,
  1133. !       4, RZ3StdPalette, 96,  75,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1134.   
  1135.     /* horizontal 64kHz */
  1136.     { 50000000, 24,  768, 600,   97,104,112,122,119, 601, 606, 616, 628, 628,
  1137. !       4, RZ3StdPalette, 96,  75,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1138.   
  1139.     /* 8-bit gfx-mode definitions */
  1140.   
  1141. !   /* IMPORTANT: the "logical" screen size can be up to 2048x2048 pixels,
  1142. !      independent from the "physical" screen size. If your code does NOT
  1143. !      support panning, please adjust the "logical" screen sizes below to
  1144. !      match the physical ones
  1145. !      */
  1146.   
  1147.     /* 640 x 480, 8 Bit, 31862 Hz, 63 Hz */
  1148.     { 26000000,  0,  640, 480,  161,175,188,200,199, 481, 483, 491, 502, 502,
  1149. !       8, RZ3StdPalette,1280,1024,  5120,   FX,    FY, KERNEL_FONT,   32,  255},
  1150.     /* This is the logical ^    ^    screen size */
  1151.   
  1152.     /* 640 x 480, 8 Bit, 38366 Hz, 76 Hz */
  1153.    { 31000000,  0,  640, 480,  161,169,182,198,197, 481, 482, 490, 502, 502,
  1154. !      8, RZ3StdPalette,1280,1024,  5120,   FX,    FY, KERNEL_FONT,   32,  255},
  1155.   
  1156.     /* 800 x 600, 8 Bit, 38537 Hz, 61 Hz */
  1157.     { 39000000,  0,  800, 600,  201,211,227,249,248, 601, 603, 613, 628, 628,
  1158. !       8, RZ3StdPalette,1280,1024,  5120,   FX,    FY, KERNEL_FONT,   32,  255},
  1159.   
  1160.     /* 1024 x 768, 8 Bit, 63862 Hz, 79 Hz */
  1161.     { 82000000,  0, 1024, 768,  257,257,277,317,316, 769, 771, 784, 804, 804,
  1162. !       8, RZ3StdPalette,1280,1024,  5120,   FX,    FY, KERNEL_FONT,   32,  255},
  1163.   
  1164.     /* 1120 x 896, 8 Bit, 64000 Hz, 69 Hz */
  1165.     { 97000000,  0, 1120, 896,  281,283,306,369,368, 897, 898, 913, 938, 938,
  1166. !       8, RZ3StdPalette,1280,1024,  5120,   FX,    FY, KERNEL_FONT,   32,  255},
  1167.   
  1168.     /* 1152 x 910, 8 Bit, 76177 Hz, 79 Hz */
  1169.     {110000000,  0, 1152, 910,  289,310,333,357,356, 911, 923, 938, 953, 953,
  1170. !       8, RZ3StdPalette,1280,1024,  5120,   FX,    FY, KERNEL_FONT,   32,  255},
  1171.   
  1172.     /* 1184 x 848, 8 Bit, 73529 Hz, 82 Hz */
  1173.     {110000000,  0, 1184, 848,  297,319,342,370,369, 849, 852, 866, 888, 888,
  1174. !       8, RZ3StdPalette,1280,1024,  5120,   FX,    FY, KERNEL_FONT,   32,  255},
  1175.   
  1176.     /* 1280 x 1024, 8 Bit, 64516 Hz, 60 Hz */
  1177.     {104000000, 0, 1280,1024,  321,323,348,399,398,1025,1026,1043,1073,1073,
  1178. !      8, RZ3StdPalette,1280,1024,  5120,   FX,    FY, KERNEL_FONT,   32,  255},
  1179.   
  1180.   /* WARNING: THE FOLLOWING MONITOR MODE EXCEEDS THE 110-MHz LIMIT THE PROCESSOR
  1181. ***************
  1182. *** 1148,1152 ****
  1183.     /* 1280 x 1024, 8 Bit, 75436 Hz, 70 Hz */
  1184.     {121000000, 0, 1280,1024,  321,322,347,397,396,1025,1026,1043,1073,1073,
  1185. !      8, RZ3StdPalette,1280,1024,  5120,    8,     8, kernel_font_8x8,   32,  255},
  1186.   
  1187.   
  1188. --- 1292,1296 ----
  1189.     /* 1280 x 1024, 8 Bit, 75436 Hz, 70 Hz */
  1190.     {121000000, 0, 1280,1024,  321,322,347,397,396,1025,1026,1043,1073,1073,
  1191. !      8, RZ3StdPalette,1280,1024,  5120,   FX,    FY, KERNEL_FONT,   32,  255},
  1192.   
  1193.   
  1194. ***************
  1195. *** 1155,1181 ****
  1196.     /* 640 x 480, 16 Bit, 31795 Hz, 63 Hz */
  1197.     { 51000000, 0,  640, 480,  321,344,369,397,396, 481, 482, 490, 502, 502,
  1198. !       16,           0,1280, 1024,  7200,    8,     8, kernel_font_8x8,   32,  255},
  1199.   
  1200.     /* 800 x 600, 16 Bit, 38500 Hz, 61 Hz */
  1201.     { 77000000, 0,  800, 600,  401,418,449,496,495, 601, 602, 612, 628, 628,
  1202. !       16,           0,1280, 1024,  7200,    8,     8, kernel_font_8x8,   32,  255},
  1203.   
  1204.     /* 1024 x 768, 16 Bit, 42768 Hz, 53 Hz */
  1205.     {110000000,  0, 1024, 768,  513,514,554,639,638, 769, 770, 783, 804, 804,
  1206. !       16,           0,1280, 1024,  7200,    8,     8, kernel_font_8x8,   32,  255},
  1207.   
  1208.     /* 864 x 648, 16 Bit, 50369 Hz, 74 Hz */
  1209.     {109000000,  0,  864, 648,  433,434,468,537,536, 649, 650, 661, 678, 678,
  1210. !       16,           0,1280, 1024,  7200,    8,     8, kernel_font_8x8,   32,  255},
  1211.   
  1212. ! /*
  1213. !  * WARNING: THE FOLLOWING MONITOR MODE EXCEEDS THE 110-MHz LIMIT THE PROCESSOR
  1214. !  *          HAS BEEN SPECIFIED FOR. USE AT YOUR OWN RISK (AND THINK ABOUT
  1215. !  *          MOUNTING SOME COOLING DEVICE AT THE PROCESSOR AND RAMDAC)!
  1216. !  */
  1217.     /* 1024 x 768, 16 Bit, 48437 Hz, 60 Hz */
  1218.     {124000000,  0, 1024, 768,  513,537,577,636,635, 769, 770, 783, 804, 804,
  1219. !       16,           0,1280, 1024,  7200,    8,     8, kernel_font_8x8,   32,  255},
  1220.   };
  1221.   
  1222.   static const char *monitor_descr[] = {
  1223. --- 1299,1353 ----
  1224.     /* 640 x 480, 16 Bit, 31795 Hz, 63 Hz */
  1225.     { 51000000, 0,  640, 480,  321,344,369,397,396, 481, 482, 490, 502, 502,
  1226. !       16,           0,1280, 1024,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1227.   
  1228.     /* 800 x 600, 16 Bit, 38500 Hz, 61 Hz */
  1229.     { 77000000, 0,  800, 600,  401,418,449,496,495, 601, 602, 612, 628, 628,
  1230. !       16,           0,1280, 1024,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1231.   
  1232.     /* 1024 x 768, 16 Bit, 42768 Hz, 53 Hz */
  1233.     {110000000,  0, 1024, 768,  513,514,554,639,638, 769, 770, 783, 804, 804,
  1234. !       16,           0,1280, 1024,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1235.   
  1236.     /* 864 x 648, 16 Bit, 50369 Hz, 74 Hz */
  1237.     {109000000,  0,  864, 648,  433,434,468,537,536, 649, 650, 661, 678, 678,
  1238. !       16,           0,1280, 1024,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1239.   
  1240. ! /* WARNING: THE FOLLOWING MONITOR MODE EXCEEDS THE 110-MHz LIMIT THE PROCESSOR
  1241. !             HAS BEEN SPECIFIED FOR. USE AT YOUR OWN RISK (AND THINK ABOUT
  1242. !             MOUNTING SOME COOLING DEVICE AT THE PROCESSOR AND RAMDAC)!     */
  1243.     /* 1024 x 768, 16 Bit, 48437 Hz, 60 Hz */
  1244.     {124000000,  0, 1024, 768,  513,537,577,636,635, 769, 770, 783, 804, 804,
  1245. !       16,           0,1280, 1024,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1246. !   /* 24-bit gfx-mode definitions */
  1247. !   /* 320 x 200, 24 Bit, 35060 Hz, 83 Hz d */
  1248. !   { 46000000,  1,  320, 200,  241,268,287,324,323, 401, 405, 412, 418, 418,
  1249. !       24,           0,1280, 1024,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1250. !   /* 640 x 400, 24 Bit, 31404 Hz, 75 Hz */
  1251. !   { 76000000,  0,  640, 400,  481,514,552,601,600, 401, 402, 409, 418, 418,
  1252. !       24,           0,1280, 1024,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1253. !   /* 724 x 482, 24 Bit, 36969 Hz, 73 Hz */
  1254. !   {101000000,  0,  724, 482,  544,576,619,682,678, 483, 487, 495, 495, 504,
  1255. !       24,           0,1280, 1024,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1256. !   /* 800 x 600, 24 Bit, 37826 Hz, 60 Hz */
  1257. !   {110000000,  0,  800, 600,  601,602,647,723,722, 601, 602, 612, 628, 628,
  1258. !       24,           0,1280, 1024,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1259. !   /* 800 x 600, 24 Bit, 43824 Hz, 69 Hz */
  1260. !   {132000000,  0,  800, 600,  601,641,688,749,748, 601, 611, 621, 628, 628,
  1261. !       24,           0,1280, 1024,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1262. !   /*1024 x 768, 24 Bit, 32051 Hz, 79 Hz i */
  1263. !   {110000000,  2, 1024, 768,  769,770,824,854,853, 385, 386, 392, 401, 401,
  1264. !       24,           0,1280, 1024,  7200,   FX,    FY, KERNEL_FONT,   32,  255},
  1265.   };
  1266. + #undef KERNEL_FONT
  1267. + #undef FX
  1268. + #undef FY
  1269.   
  1270.   static const char *monitor_descr[] = {
  1271. ***************
  1272. *** 1192,1196 ****
  1273.     "GFX-8 (640x480) 31.5kHz",
  1274.     "GFX-8 (640x480) 38kHz",
  1275. -   "GFX-8 (800x600) 31.6kHz",
  1276.     "GFX-8 (800x600) 38.5kHz",
  1277.     "GFX-8 (1024x768) 64kHz",
  1278. --- 1364,1367 ----
  1279. ***************
  1280. *** 1206,1209 ****
  1281. --- 1377,1387 ----
  1282.     "GFX-16 (864x648) 50kHz",
  1283.     "GFX-16 (1024x768) 48.5kHz ***EXCEEDS CHIP LIMIT!!!***",
  1284. +   "GFX-24 (320x200 d) 35kHz",
  1285. +   "GFX-24 (640x400) 31.4kHz",
  1286. +   "GFX-24 (724x482) 37kHz",
  1287. +   "GFX-24 (800x600) 38kHz",
  1288. +   "GFX-24 (800x600) 44kHz ***EXCEEDS CHIP LIMIT!!!***",
  1289. +   "GFX-24 (1024x768) 32kHz-i",
  1290.   };
  1291.   
  1292. ***************
  1293. *** 1211,1216 ****
  1294.   
  1295.   /* patchable */
  1296. ! int rh_default_mon = 0;
  1297. ! int rh_default_gfx = 4;
  1298.   
  1299.   static struct MonDef *current_mon;
  1300. --- 1389,1394 ----
  1301.   
  1302.   /* patchable */
  1303. ! int rh_default_mon = 2;
  1304. ! int rh_default_gfx = 8;
  1305.   
  1306.   static struct MonDef *current_mon;
  1307. ***************
  1308. *** 1334,1338 ****
  1309.          sizeof (vm->mode_descr));
  1310.       vm->pixel_clock  = md->FQ;
  1311. !     vm->disp_width   = md->MW;
  1312.       vm->disp_height  = md->MH;
  1313.       vm->depth        = md->DEP;
  1314. --- 1512,1517 ----
  1315.          sizeof (vm->mode_descr));
  1316.       vm->pixel_clock  = md->FQ;
  1317. !     vm->disp_width   = (md->DEP == 4) ? md->MW : md->TX;
  1318. !     vm->disp_height  = (md->DEP == 4) ? md->MH : md->TY;
  1319.       vm->disp_height  = md->MH;
  1320.       vm->depth        = md->DEP;
  1321. ***************
  1322. *** 1353,1360 ****
  1323.   
  1324.   int
  1325. ! rh_setvmode(gp, mode, txtonly)
  1326.       struct grf_softc *gp;
  1327.       unsigned mode;
  1328. !     int txtonly;
  1329.   {
  1330.       struct MonDef *md;
  1331. --- 1532,1539 ----
  1332.   
  1333.   int
  1334. ! rh_setvmode(gp, mode, type)
  1335.       struct grf_softc *gp;
  1336.       unsigned mode;
  1337. !     enum mode_type type;
  1338.   {
  1339.       struct MonDef *md;
  1340. ***************
  1341. *** 1364,1368 ****
  1342.           return(EINVAL);
  1343.   
  1344. !     if (txtonly && monitor_defs[mode-1].DEP != 4)
  1345.           return(EINVAL);
  1346.   
  1347. --- 1543,1548 ----
  1348.           return(EINVAL);
  1349.   
  1350. !     if ((type == MT_TXTONLY && monitor_defs[mode-1].DEP != 4)
  1351. !         || (type == MT_GFXONLY && monitor_defs[mode-1].DEP == 4))
  1352.           return(EINVAL);
  1353.   
  1354. ***************
  1355. *** 1385,1397 ****
  1356.       int a2, a3;
  1357.   {
  1358. -   /* implement these later... */
  1359.       switch (cmd) {
  1360.       case GM_GRFON:
  1361. !         rh_setvmode (gp, rh_default_gfx + 1, 0);
  1362.           return(0);
  1363.   
  1364.       case GM_GRFOFF:
  1365. !         rh_setvmode (gp, rh_default_mon + 1, 0);
  1366.           return(0);
  1367.   
  1368. --- 1565,1575 ----
  1369.       int a2, a3;
  1370.   {
  1371.       switch (cmd) {
  1372.       case GM_GRFON:
  1373. !         rh_setvmode (gp, rh_default_gfx + 1, MT_GFXONLY);
  1374.           return(0);
  1375.   
  1376.       case GM_GRFOFF:
  1377. !         rh_setvmode (gp, rh_default_mon + 1, MT_TXTONLY);
  1378.           return(0);
  1379.   
  1380. ***************
  1381. *** 1403,1407 ****
  1382.   
  1383.       case GM_GRFSETVMODE:
  1384. !         return(rh_setvmode (gp, *(unsigned *) arg, 1));
  1385.   
  1386.       case GM_GRFGETNUMVM:
  1387. --- 1581,1586 ----
  1388.   
  1389.       case GM_GRFSETVMODE:
  1390. !         return(rh_setvmode (gp, *(unsigned *) arg, 
  1391. !                     (gp->g_flags & GF_GRFON) ? MT_GFXONLY : MT_TXTONLY));
  1392.   
  1393.       case GM_GRFGETNUMVM:
  1394. ***************
  1395. *** 1614,1617 ****
  1396. --- 1793,1797 ----
  1397.            */
  1398.   
  1399. + #ifdef RZ3_64BIT_SPRITE
  1400.           info->size.x = 64;
  1401.           info->size.y = 64;
  1402. ***************
  1403. *** 1634,1637 ****
  1404. --- 1814,1833 ----
  1405.               *mp++  = (~bp20) & (bp20 & ~bp21);
  1406.           }
  1407. + #else
  1408. +         info->size.x = 32;
  1409. +         info->size.y = 32;
  1410. +         for (row = 0, hwp = (u_long *)(ba + LM_OFFSET + HWC_MEM_OFF),
  1411. +             mp = mask, imp = image;
  1412. +             row < 32;
  1413. +             row++) {
  1414. +             u_long bp10, bp11;
  1415. +             bp10 = *hwp++;
  1416. +             bp11 = *hwp++;
  1417. +             M2I (bp10);
  1418. +             M2I (bp11);
  1419. +             *imp++ = (~bp10) & bp11;
  1420. +             *mp++  = (~bp10) | (bp10 & ~bp11);
  1421. +         }
  1422. + #endif
  1423.           copyout (image, info->image, sizeof (image));
  1424.           copyout (mask, info->mask, sizeof (mask));
  1425. ***************
  1426. *** 1663,1670 ****
  1427. --- 1859,1873 ----
  1428.           short row;
  1429.   
  1430. + #ifdef RZ3_64BIT_SPRITE
  1431.           if (info->size.y > 64)
  1432.               info->size.y = 64;
  1433.           if (info->size.x > 64)
  1434.               info->size.x = 64;
  1435. + #else
  1436. +         if (info->size.y > 32)
  1437. +             info->size.y = 32;
  1438. +         if (info->size.x > 32)
  1439. +             info->size.x = 32;
  1440. + #endif
  1441.   
  1442.           if (info->size.x < 32)
  1443. ***************
  1444. *** 1694,1697 ****
  1445. --- 1897,1901 ----
  1446.               m1  = *(unsigned long *)mp;
  1447.               mp  += 4;
  1448. + #ifdef RZ3_64BIT_SPRITE
  1449.               if (info->size.x > 32) {
  1450.                         im2 = *(unsigned long *)imp;
  1451. ***************
  1452. *** 1701,1704 ****
  1453. --- 1905,1909 ----
  1454.               }
  1455.               else
  1456. + #endif
  1457.                   im2 = m2 = 0;
  1458.   
  1459. ***************
  1460. *** 1709,1716 ****
  1461. --- 1914,1926 ----
  1462.   
  1463.               *hwp++ = ~m1;
  1464. + #ifdef RZ3_64BIT_SPRITE
  1465.               *hwp++ = ~m2;
  1466. + #endif
  1467.               *hwp++ = m1 & im1;
  1468. + #ifdef RZ3_64BIT_SPRITE
  1469.               *hwp++ = m2 & im2;
  1470. + #endif
  1471.           }
  1472. + #ifdef RZ3_64BIT_SPRITE
  1473.           for (; row < 64; row++) {
  1474.               *hwp++ = 0xffffffff;
  1475. ***************
  1476. *** 1719,1722 ****
  1477. --- 1929,1938 ----
  1478.               *hwp++ = 0x00000000;
  1479.           }
  1480. + #else
  1481. +         for (; row < 32; row++) {
  1482. +             *hwp++ = 0xffffffff;
  1483. +             *hwp++ = 0x00000000;
  1484. +         }
  1485. + #endif
  1486.   
  1487.           free(image, M_TEMP);
  1488. ***************
  1489. *** 1729,1732 ****
  1490. --- 1945,1949 ----
  1491.       }
  1492.       if (info->set & GRFSPRSET_ENABLE) {
  1493. + #if 0
  1494.           if (info->enable)
  1495.               control = 0x85;
  1496. ***************
  1497. *** 1734,1737 ****
  1498. --- 1951,1955 ----
  1499.               control = 0;
  1500.           WSeq(ba, SEQ_ID_CURSOR_CONTROL, control);
  1501. + #endif
  1502.       }
  1503.       if (info->set & GRFSPRSET_POS)
  1504. ***************
  1505. *** 1750,1755 ****
  1506. --- 1968,1978 ----
  1507.       struct grf_position *pos;
  1508.   {
  1509. + #ifdef RZ3_64BIT_SPRITE
  1510.       pos->x = 64;
  1511.       pos->y = 64;
  1512. + #else
  1513. +     pos->x = 32;
  1514. +     pos->y = 32;
  1515. + #endif
  1516.   
  1517.       return(0);
  1518. ***************
  1519. *** 1763,1770 ****
  1520.   {
  1521.       struct MonDef *md = (struct MonDef *)gp->g_data;
  1522. !     if (md->DEP < 16)
  1523.           RZ3BitBlit(gp, bb);
  1524. !     else
  1525.           RZ3BitBlit16(gp, bb);
  1526.   }
  1527.   #endif    /* NGRF */
  1528. --- 1986,1995 ----
  1529.   {
  1530.       struct MonDef *md = (struct MonDef *)gp->g_data;
  1531. !     if (md->DEP <= 8)
  1532.           RZ3BitBlit(gp, bb);
  1533. !     else if (md->DEP <= 16)
  1534.           RZ3BitBlit16(gp, bb);
  1535. +     else
  1536. +           RZ3BitBlit24(gp, bb);
  1537.   }
  1538.   #endif    /* NGRF */
  1539. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/grf_rhreg.h sys/arch/amiga/dev/grf_rhreg.h
  1540. *** sys.orig/arch/amiga/dev/grf_rhreg.h    Tue Dec 20 09:33:17 1994
  1541. --- sys/arch/amiga/dev/grf_rhreg.h    Sun Dec 25 09:25:24 1994
  1542. ***************
  1543. *** 16,25 ****
  1544.                                 text-screen  */
  1545.   
  1546. - #define MEMCLK 65000000  /* this is the memory clock value, you shouldn't
  1547. -                             set it to less than 65000000, higher values may
  1548. -                             speed up blits a little bit, if you raise this
  1549. -                             value too much, some trash will appear on your
  1550. -                             screen. */
  1551.   #define MEMSIZE 4        /* Set this to 1 or 4 (MB), according to the
  1552.                               RAM on your Retina BLT Z3 board */
  1553. --- 16,19 ----
  1554. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/grf_rt.c sys/arch/amiga/dev/grf_rt.c
  1555. *** sys.orig/arch/amiga/dev/grf_rt.c    Tue Dec 20 09:33:16 1994
  1556. --- sys/arch/amiga/dev/grf_rt.c    Thu Dec 22 21:13:11 1994
  1557. ***************
  1558. *** 210,215 ****
  1559.   
  1560.   /* patchable */
  1561. ! int retina_default_mon = 0;
  1562. ! int retina_default_gfx = 4;
  1563.       
  1564.   #endif
  1565. --- 210,215 ----
  1566.   
  1567.   /* patchable */
  1568. ! int retina_default_mon = 2;
  1569. ! int retina_default_gfx = 5;
  1570.       
  1571.   #endif
  1572. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/grfioctl.h sys/arch/amiga/dev/grfioctl.h
  1573. *** sys.orig/arch/amiga/dev/grfioctl.h    Tue Dec 20 09:33:16 1994
  1574. --- sys/arch/amiga/dev/grfioctl.h    Sun Dec 25 07:02:51 1994
  1575. ***************
  1576. *** 211,214 ****
  1577.   };
  1578.   
  1579. ! #define GRFIOCBITBLT    _IOR('G', 57, struct grf_bitblt)
  1580.   
  1581. --- 211,214 ----
  1582.   };
  1583.   
  1584. ! #define GRFIOCBITBLT    _IOW('G', 57, struct grf_bitblt)
  1585.   
  1586. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/ite.c sys/arch/amiga/dev/ite.c
  1587. *** sys.orig/arch/amiga/dev/ite.c    Tue Dec 20 09:33:16 1994
  1588. --- sys/arch/amiga/dev/ite.c    Thu Dec 22 21:13:11 1994
  1589. ***************
  1590. *** 87,92 ****
  1591.   u_int    ite_confunits;            /* configured units */
  1592.   
  1593. ! int    start_repeat_timeo = 30;    /* first repeat after x s/100 */
  1594. ! int    next_repeat_timeo = 10;        /* next repeat after x s/100 */
  1595.   
  1596.   int    ite_default_wrap = 1;        /* you want vtxxx-nam, binpatch */
  1597. --- 87,92 ----
  1598.   u_int    ite_confunits;            /* configured units */
  1599.   
  1600. ! int    start_repeat_timeo = 20;    /* first repeat after x s/100 */
  1601. ! int    next_repeat_timeo = 5;        /* next repeat after x s/100 */
  1602.   
  1603.   int    ite_default_wrap = 1;        /* you want vtxxx-nam, binpatch */
  1604. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/par.c sys/arch/amiga/dev/par.c
  1605. *** sys.orig/arch/amiga/dev/par.c    Tue Dec 20 09:33:16 1994
  1606. --- sys/arch/amiga/dev/par.c    Thu Dec 29 04:08:57 1994
  1607. ***************
  1608. *** 55,58 ****
  1609. --- 55,60 ----
  1610.   #include <amiga/dev/parioctl.h>
  1611.   
  1612. + /* this used to be in systm.h */
  1613. + typedef void (*timeout_t) __P((void *));
  1614.   
  1615.   struct    par_softc {
  1616. ***************
  1617. *** 62,65 ****
  1618. --- 64,69 ----
  1619.   #define sc_timo  sc_param.timo
  1620.   #define sc_delay sc_param.delay
  1621. +     u_char    *sc_buf;
  1622. +     u_int    sc_buflen;
  1623.   } *par_softcp;
  1624.   
  1625. ***************
  1626. *** 154,157 ****
  1627. --- 158,165 ----
  1628.       sc->sc_timo = parmstohz(PAR_TIMO);
  1629.       sc->sc_delay = parmstohz(PAR_DELAY);
  1630. +     sc->sc_buf = (u_char*) malloc (sc->sc_burst, M_DEVBUF, M_WAITOK);
  1631. +     sc->sc_buflen = sc->sc_burst;
  1632.       /* enable interrupts for CIAA-FLG */
  1633.       ciaa.icr = CIA_ICR_IR_SC | CIA_ICR_FLG;
  1634. ***************
  1635. *** 171,174 ****
  1636. --- 179,187 ----
  1637.   #endif
  1638.     sc->sc_flags &= ~(PARF_OPEN|PARF_OREAD|PARF_OWRITE);
  1639. +   free(sc->sc_buf, M_DEVBUF);
  1640. +   sc->sc_buf = 0;
  1641. +   sc->sc_buflen = 0;
  1642.     /* don't allow interrupts for CIAA-FLG any longer */
  1643.     ciaa.icr = CIA_ICR_FLG;
  1644. ***************
  1645. *** 259,268 ****
  1646.   #endif
  1647.     buflen = min(sc->sc_burst, uio->uio_resid);
  1648. !   buf = (char *)malloc(buflen, M_DEVBUF, M_WAITOK);
  1649.     sc->sc_flags |= PARF_UIO;
  1650.     if (sc->sc_timo > 0) 
  1651.       {
  1652.         sc->sc_flags |= PARF_TIMO;
  1653. !       timeout(partimo, (void *)unit, sc->sc_timo);
  1654.       }
  1655.     while (uio->uio_resid > 0) 
  1656. --- 272,281 ----
  1657.   #endif
  1658.     buflen = min(sc->sc_burst, uio->uio_resid);
  1659. !   buf = sc->sc_buf;
  1660.     sc->sc_flags |= PARF_UIO;
  1661.     if (sc->sc_timo > 0) 
  1662.       {
  1663.         sc->sc_flags |= PARF_TIMO;
  1664. !       timeout((timeout_t) partimo, (void *) unit, sc->sc_timo);
  1665.       }
  1666.     while (uio->uio_resid > 0) 
  1667. ***************
  1668. *** 277,289 ****
  1669.       }
  1670.   again:
  1671. -       s = splbio();
  1672. - #if 0
  1673. -       if ((sc->sc_flags & PARF_UIO) && hpibreq(&sc->sc_dq) == 0)
  1674. -     sleep(sc, PRIBIO+1);
  1675. - #endif
  1676.         /*
  1677. !        * Check if we timed out during sleep or uiomove
  1678.          */
  1679. !       (void) splsoftclock();
  1680.         if ((sc->sc_flags & PARF_UIO) == 0) 
  1681.       {
  1682. --- 290,297 ----
  1683.       }
  1684.   again:
  1685.         /*
  1686. !        * Check if we timed out during uiomove
  1687.          */
  1688. !       s = splsoftclock();
  1689.         if ((sc->sc_flags & PARF_UIO) == 0) 
  1690.       {
  1691. ***************
  1692. *** 295,299 ****
  1693.         if (sc->sc_flags & PARF_TIMO) 
  1694.           {
  1695. !           untimeout(partimo, (void *)unit);
  1696.             sc->sc_flags &= ~PARF_TIMO;
  1697.           }
  1698. --- 303,307 ----
  1699.         if (sc->sc_flags & PARF_TIMO) 
  1700.           {
  1701. !           untimeout((timeout_t) partimo, (void *) unit);
  1702.             sc->sc_flags &= ~PARF_TIMO;
  1703.           }
  1704. ***************
  1705. *** 317,323 ****
  1706.         
  1707.         s = splbio();
  1708. - #if 0
  1709. -       hpibfree(&sc->sc_dq);
  1710. - #endif
  1711.   #ifdef DEBUG
  1712.         if (pardebug & PDB_IO)
  1713. --- 325,328 ----
  1714. ***************
  1715. *** 358,366 ****
  1716.          * Implement inter-read delay
  1717.          */
  1718. !       if (sc->sc_delay > 0) 
  1719.       {
  1720.         sc->sc_flags |= PARF_DELAY;
  1721. !       timeout(parstart, (void *)unit, sc->sc_delay);
  1722. !       error = tsleep(sc, PCATCH|PZERO-1, "par-cdelay", 0);
  1723.         if (error) 
  1724.           {
  1725. --- 363,371 ----
  1726.          * Implement inter-read delay
  1727.          */
  1728. !       if (uio->uio_rw == UIO_READ && sc->sc_delay > 0) 
  1729.       {
  1730.         sc->sc_flags |= PARF_DELAY;
  1731. !       timeout((timeout_t) parstart, (void *) unit, sc->sc_delay);
  1732. !       error = tsleep((caddr_t) sc, PCATCH|PZERO-1, "par-cdelay", 0);
  1733.         if (error) 
  1734.           {
  1735. ***************
  1736. *** 385,394 ****
  1737.     if (sc->sc_flags & PARF_TIMO) 
  1738.       {
  1739. !       untimeout(partimo, (void *)unit);
  1740.         sc->sc_flags &= ~PARF_TIMO;
  1741.       }
  1742.     if (sc->sc_flags & PARF_DELAY) 
  1743.       {
  1744. !       untimeout(parstart, (void *)unit);
  1745.         sc->sc_flags &= ~PARF_DELAY;
  1746.       }
  1747. --- 390,399 ----
  1748.     if (sc->sc_flags & PARF_TIMO) 
  1749.       {
  1750. !       untimeout((timeout_t) partimo, (void *) unit);
  1751.         sc->sc_flags &= ~PARF_TIMO;
  1752.       }
  1753.     if (sc->sc_flags & PARF_DELAY) 
  1754.       {
  1755. !       untimeout((timeout_t) parstart, (void *) unit);
  1756.         sc->sc_flags &= ~PARF_DELAY;
  1757.       }
  1758. ***************
  1759. *** 406,410 ****
  1760.   #endif
  1761.       }
  1762. -   free(buf, M_DEVBUF);
  1763.   #ifdef DEBUG
  1764.     if (pardebug & (PDB_FOLLOW|PDB_IO))
  1765. --- 411,414 ----
  1766. ***************
  1767. *** 445,448 ****
  1768. --- 449,458 ----
  1769.         pp->timo = parmstohz(upp->timo);
  1770.         pp->delay = parmstohz(upp->delay);
  1771. +       if (pp->burst > sc->sc_buflen) 
  1772. +     {
  1773. +             free (sc->sc_buf, M_DEVBUF);
  1774. +       sc->sc_buf = (u_char *) malloc (sc->sc_burst, M_DEVBUF, M_WAITOK);
  1775. +       sc->sc_buflen = sc->sc_burst;
  1776. +     }
  1777.         break;
  1778.   
  1779. ***************
  1780. *** 480,488 ****
  1781.   }
  1782.   
  1783. ! /* stuff below here if for interrupt driven output of data thru
  1784.      the parallel port. */
  1785.   
  1786.   int partimeout_pending;
  1787.   int parsend_pending;
  1788.   
  1789.   void
  1790. --- 490,499 ----
  1791.   }
  1792.   
  1793. ! /* stuff below here is for interrupt driven output of data thru
  1794.      the parallel port. */
  1795.   
  1796.   int partimeout_pending;
  1797.   int parsend_pending;
  1798. + u_char *parbp;
  1799.   
  1800.   void
  1801. ***************
  1802. *** 499,580 ****
  1803.           printf("parintr %s\n", mask ? "FLG" : "tout");
  1804.   #endif
  1805. !     /*
  1806. !      * if invoked from timeout handler, mask will be 0,
  1807. !      * if from interrupt, it will contain the cia-icr mask,
  1808. !      * which is != 0
  1809. !      */
  1810. !     if (mask) {
  1811. !         if (partimeout_pending)
  1812. !             untimeout(parintr, 0);
  1813. !         if (parsend_pending)
  1814. !             parsend_pending = 0;
  1815. !     }
  1816. !     /* either way, there won't be a timeout pending any longer */
  1817.       partimeout_pending = 0;
  1818. !   
  1819. !     wakeup(parintr);
  1820. !     splx(s);
  1821.   }
  1822.   
  1823.   int
  1824. ! parsendch (ch)
  1825. !      u_char ch;
  1826.   {
  1827. !   int error = 0;
  1828. !   int s;
  1829. !   /* if either offline, busy or out of paper, wait for that
  1830. !      condition to clear */
  1831. !   s = splclock();
  1832. !   while (!error 
  1833. !      && (parsend_pending 
  1834. !          || ((ciab.pra ^ CIAB_PRA_SEL)
  1835. !          & (CIAB_PRA_SEL|CIAB_PRA_BUSY|CIAB_PRA_POUT))))
  1836. !     {
  1837. !       extern int hz;
  1838.   
  1839. ! #ifdef DEBUG
  1840. !       if (pardebug & PDB_INTERRUPT)
  1841. !     printf ("parsendch, port = $%x\n",
  1842. !         ((ciab.pra ^ CIAB_PRA_SEL)
  1843. !          & (CIAB_PRA_SEL|CIAB_PRA_BUSY|CIAB_PRA_POUT)));
  1844. ! #endif
  1845. !       /* wait a second, and try again */
  1846. !       timeout(parintr, 0, hz);
  1847. !       partimeout_pending = 1;
  1848. !       /* this is essentially a flipflop to have us wait for the
  1849. !      first character being transmitted when trying to transmit
  1850. !      the second, etc. */
  1851. !       parsend_pending = 0;
  1852. !       /* it's quite important that a parallel putc can be
  1853. !      interrupted, given the possibility to lock a printer
  1854. !      in an offline condition.. */
  1855. !       if (error = tsleep(parintr, PCATCH|PZERO-1, "parsendch", 0))
  1856. !     {
  1857. ! #ifdef DEBUG
  1858. !       if (pardebug & PDB_INTERRUPT)
  1859. !         printf ("parsendch interrupted, error = %d\n", error);
  1860. ! #endif
  1861. !       if (partimeout_pending)
  1862. !         untimeout(parintr, 0);
  1863. !       partimeout_pending = 0;
  1864. !     }
  1865. !     }
  1866. !   if (! error)
  1867. !     {
  1868. ! #ifdef DEBUG
  1869. !       if (pardebug & PDB_INTERRUPT)
  1870. !     printf ("#%d", ch);
  1871. ! #endif
  1872. !       ciaa.prb = ch;
  1873. !       parsend_pending = 1;
  1874. !     }
  1875. !   splx (s);
  1876.   
  1877. -   return error;
  1878.   }
  1879.   
  1880. --- 510,544 ----
  1881.           printf("parintr %s\n", mask ? "FLG" : "tout");
  1882.   #endif
  1883. !     if (partimeout_pending)
  1884. !         untimeout ((timeout_t) parintr, 0);
  1885.       partimeout_pending = 0;
  1886. !     splx (s);
  1887. !     parsendch ();
  1888.   }
  1889.   
  1890.   int
  1891. ! parsendch ()
  1892.   {
  1893. !     int s;
  1894.   
  1895. !     s = splclock();
  1896. !     /* if port is offline, wait a second, and fake a new interrupt, which
  1897. !      * will take us here again. */
  1898. !     if (((ciab.pra ^ CIAB_PRA_SEL)
  1899. !          & (CIAB_PRA_SEL|CIAB_PRA_BUSY|CIAB_PRA_POUT))) {
  1900. !         extern int hz;
  1901. !         timeout ((timeout_t) parintr, 0, hz);
  1902. !         partimeout_pending = 1;
  1903. !     } else if (parsend_pending > 0) {
  1904. !         /* transmit next character */
  1905. !         ciaa.prb = *parbp++;
  1906. !         parsend_pending--;
  1907. !         } else {
  1908. !               /* no more characters to transmit, wake up parsend() */
  1909. !         wakeup ((caddr_t) parintr);
  1910. !         }
  1911. !     splx (s);
  1912.   
  1913.   }
  1914.   
  1915. ***************
  1916. *** 585,603 ****
  1917.        int len;
  1918.   {
  1919. !   int err, orig_len = len;
  1920.   
  1921. !   /* make sure I/O lines are setup right for output */
  1922.   
  1923. -   /* control lines set to input */
  1924. -   ciab.ddra &= ~(CIAB_PRA_SEL|CIAB_PRA_POUT|CIAB_PRA_BUSY);
  1925. -   /* data lines to output */
  1926. -   ciaa.ddrb = 0xff;
  1927. -   
  1928. -   for (; len; len--, buf++)
  1929. -     if (err = parsendch (*buf))
  1930. -       return err < 0 ? -EINTR : -err;
  1931. -   /* either all or nothing.. */
  1932. -   return orig_len;
  1933.   }
  1934.   
  1935. --- 549,583 ----
  1936.        int len;
  1937.   {
  1938. !     int err, s;
  1939.   
  1940. !     /* guess that can't happen, right? */
  1941. !     if (len <= 0)
  1942. !         return -EINVAL;
  1943. !     /* make sure I/O lines are setup right for output */
  1944. !     /* control lines set to input */
  1945. !     ciab.ddra &= ~(CIAB_PRA_SEL|CIAB_PRA_POUT|CIAB_PRA_BUSY);
  1946. !     /* data lines to output */
  1947. !     ciaa.ddrb = 0xff;
  1948. !     s = spltty();
  1949. !     /* pass buffer information to interrupt handler */
  1950. !     parbp = buf;
  1951. !     parsend_pending = len;
  1952. !     /* send first character */
  1953. !     parsendch();
  1954. !     err = tsleep ((caddr_t) parintr, PCATCH|PZERO-1, "parsend", 0);
  1955. !     len -= parsend_pending;
  1956. !     parsend_pending = 0;
  1957. !     if (partimeout_pending)
  1958. !         untimeout ((timeout_t) parintr, 0);
  1959. !     splx (s);
  1960. !     if (err)
  1961. !         return err < 0 ? -EINTR : -err;
  1962. !     return len;
  1963.   
  1964.   }
  1965.   
  1966. ***************
  1967. *** 609,615 ****
  1968.        int len;
  1969.   {
  1970. !   /* oh deary me, something's gotta be left to be implemented
  1971. !      later... */
  1972. !   return 0;
  1973.   }
  1974.   
  1975. --- 589,597 ----
  1976.        int len;
  1977.   {
  1978. !     /* oh deary me, something's gotta be left to be implemented
  1979. !      * later... */
  1980. !     return 0;
  1981.   }
  1982.   
  1983. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/ser.c sys/arch/amiga/dev/ser.c
  1984. *** sys.orig/arch/amiga/dev/ser.c    Tue Dec 20 09:33:16 1994
  1985. --- sys/arch/amiga/dev/ser.c    Wed Dec 28 23:08:42 1994
  1986. ***************
  1987. *** 72,77 ****
  1988.       sizeof(struct device), NULL, 0 };
  1989.   
  1990.   #define SEROBUF_SIZE 32
  1991. ! #define SERIBUF_SIZE 512
  1992.   
  1993.   int    serstart(), serparam(), serintr(), serhwiflow();
  1994. --- 72,83 ----
  1995.       sizeof(struct device), NULL, 0 };
  1996.   
  1997. + #ifndef SEROBUF_SIZE
  1998.   #define SEROBUF_SIZE 32
  1999. ! #endif
  2000. ! #ifndef SERIBUF_SIZE
  2001. ! #define SERIBUF_SIZE 16738
  2002. ! #endif
  2003. ! #define splser() spl5()
  2004.   
  2005.   int    serstart(), serparam(), serintr(), serhwiflow();
  2006. ***************
  2007. *** 447,451 ****
  2008.           sbwpt = serbuf;
  2009.       ++sbcnt;
  2010. !     if (sbcnt > SERIBUF_SIZE - 4)
  2011.           CLRRTS(ciab.pra);    /* drop RTS if buffer almost full */
  2012.   }
  2013. --- 453,457 ----
  2014.           sbwpt = serbuf;
  2015.       ++sbcnt;
  2016. !     if (sbcnt > SERIBUF_SIZE - 20)
  2017.           CLRRTS(ciab.pra);    /* drop RTS if buffer almost full */
  2018.   }
  2019. ***************
  2020. *** 476,480 ****
  2021.           ovfl = 0;
  2022.           /* lock against ser_fastint() */
  2023. !         s2 = spl5();
  2024.           sbcnt--;
  2025.           if (sbrpt == serbuf + SERIBUF_SIZE)
  2026. --- 482,486 ----
  2027.           ovfl = 0;
  2028.           /* lock against ser_fastint() */
  2029. !         s2 = splser();
  2030.           sbcnt--;
  2031.           if (sbrpt == serbuf + SERIBUF_SIZE)
  2032. ***************
  2033. *** 1012,1016 ****
  2034.       int c, s;
  2035.   
  2036. !     s = splhigh();
  2037.       /*
  2038.        * poll
  2039. --- 1018,1022 ----
  2040.       int c, s;
  2041.   
  2042. !     s = splser();
  2043.       /*
  2044.        * poll
  2045. ***************
  2046. *** 1038,1042 ****
  2047.       int s;
  2048.   
  2049. !     s = splhigh();
  2050.   
  2051.       if (serconsinit == 0) {
  2052. --- 1044,1048 ----
  2053.       int s;
  2054.   
  2055. !     s = splser();
  2056.   
  2057.       if (serconsinit == 0) {
  2058. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/include/cpu.h sys/arch/amiga/include/cpu.h
  2059. *** sys.orig/arch/amiga/include/cpu.h    Tue Dec 20 09:33:17 1994
  2060. --- sys/arch/amiga/include/cpu.h    Wed Dec 28 02:14:40 1994
  2061. ***************
  2062. *** 73,77 ****
  2063.   
  2064.   #define    CLKF_USERMODE(framep)    (((framep)->sr & PSL_S) == 0)
  2065. ! #define    CLKF_BASEPRI(framep)    (((framep)->sr & PSL_IPL) == 0)
  2066.   #define    CLKF_PC(framep)        ((framep)->pc)
  2067.   #if 0
  2068. --- 73,78 ----
  2069.   
  2070.   #define    CLKF_USERMODE(framep)    (((framep)->sr & PSL_S) == 0)
  2071. ! /*#define    CLKF_BASEPRI(framep)    (((framep)->sr & PSL_IPL) == 0)*/
  2072. ! #define    CLKF_BASEPRI(framep)    (0)
  2073.   #define    CLKF_PC(framep)        ((framep)->pc)
  2074.   #if 0
  2075. ***************
  2076. *** 109,124 ****
  2077.   int    want_resched;        /* resched() was called */
  2078.   
  2079. ! /*
  2080. !  * simulated software interrupt register
  2081. !  */
  2082. ! extern unsigned char ssir;
  2083. ! #define SIR_NET        0x1
  2084. ! #define SIR_CLOCK    0x2
  2085. ! #define siroff(x)    ssir &= ~(x)
  2086. ! #define setsoftnet()    ssir |= SIR_NET
  2087. ! #define setsoftclock()    ssir |= SIR_CLOCK
  2088.   
  2089.   /*
  2090. --- 110,115 ----
  2091.   int    want_resched;        /* resched() was called */
  2092.   
  2093. ! /* include support for software interrupts */
  2094. ! #include <machine/mtpr.h>
  2095.   
  2096.   /*
  2097. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/include/mtpr.h sys/arch/amiga/include/mtpr.h
  2098. *** sys.orig/arch/amiga/include/mtpr.h    Tue Dec 20 09:33:18 1994
  2099. --- sys/arch/amiga/include/mtpr.h    Tue Dec 27 20:26:34 1994
  2100. ***************
  2101. *** 46,60 ****
  2102.   
  2103.   /*
  2104. !  * simulated software interrupt register
  2105.    */
  2106.   
  2107.   extern unsigned char ssir;
  2108.   
  2109. ! #define SIR_NET        0x1
  2110. ! #define SIR_CLOCK    0x2
  2111.   
  2112.   #define siroff(x)    ssir &= ~(x)
  2113. ! #define setsoftnet()    ssir |= SIR_NET
  2114. ! #define setsoftclock()    ssir |= SIR_CLOCK
  2115.   
  2116.   #endif /* !_MACHINE_MPTR_H_ */
  2117. --- 46,71 ----
  2118.   
  2119.   /*
  2120. !  * simulated software interrupt register (extends hardware
  2121. !  * SOFTINT bit)
  2122.    */
  2123.   
  2124. + /*
  2125. +  * this makes it pretty machine dependant. Should this go into
  2126. +  * <amiga/amiga/mtpr.h> ?
  2127. +  */
  2128. + #include <amiga/amiga/custom.h>
  2129.   extern unsigned char ssir;
  2130.   
  2131. ! #define SIR_NET        0x1    /* call netintr */
  2132. ! #define SIR_CLOCK    0x2    /* call softclock */
  2133. ! #define SIR_CBACK    0x4    /* walk the sicallback-chain */
  2134.   
  2135.   #define siroff(x)    ssir &= ~(x)
  2136. ! #define setsoftint()    (custom.intreq = INTF_SETCLR|INTF_SOFTINT)
  2137. ! #define clrsoftint()    (custom.intreq = INTF_SOFTINT)
  2138. ! #define setsoftnet()    (ssir |= SIR_NET, setsoftint())
  2139. ! #define setsoftclock()    (ssir |= SIR_CLOCK, setsoftint())
  2140. ! #define setsoftcback()    (ssir |= SIR_CBACK, setsoftint())
  2141.   
  2142.   #endif /* !_MACHINE_MPTR_H_ */
  2143. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/include/param.h sys/arch/amiga/include/param.h
  2144. *** sys.orig/arch/amiga/include/param.h    Tue Dec 20 09:33:18 1994
  2145. --- sys/arch/amiga/include/param.h    Wed Dec 28 22:58:53 1994
  2146. ***************
  2147. *** 152,159 ****
  2148.   
  2149.   /*
  2150. !  * spl functions; all but spl0 are done in-line
  2151.    */
  2152.   #include <machine/psl.h>
  2153.   
  2154.   #define _debug_spl(s) \
  2155.   ({ \
  2156. --- 152,164 ----
  2157.   
  2158.   /*
  2159. !  * spl functions; all are normally done in-line
  2160.    */
  2161.   #include <machine/psl.h>
  2162.   
  2163. + /*
  2164. +  * point to the custom.intenar and custom.intenaw respectively.
  2165. +  */
  2166. + extern volatile unsigned short *amiga_intena_read, *amiga_intena_write;
  2167.   #define _debug_spl(s) \
  2168.   ({ \
  2169. ***************
  2170. *** 182,186 ****
  2171.   #endif
  2172.   
  2173. ! /* spl0 requires checking for software interrupts */
  2174.   #define spl1()    _spl(PSL_S|PSL_IPL1)
  2175.   #define spl2()    _spl(PSL_S|PSL_IPL2)
  2176. --- 187,191 ----
  2177.   #endif
  2178.   
  2179. ! #define spl0()    _spl(PSL_S|PSL_IPL0)
  2180.   #define spl1()    _spl(PSL_S|PSL_IPL1)
  2181.   #define spl2()    _spl(PSL_S|PSL_IPL2)
  2182. ***************
  2183. *** 196,211 ****
  2184.   #define splbio()    spl3()
  2185.   #define splimp()    spl3()
  2186. - /*
  2187. -  * lowered to spl4 to allow for serial input into
  2188. -  * private ringbuffer inspite of spltty
  2189. -  */
  2190.   #define spltty()    spl4()
  2191. ! #define splclock()    spl6()
  2192. ! #define splstatclock()    spl6()
  2193. ! #define splvm()        spl6()
  2194. ! #define splhigh()    spl7()
  2195. ! #define splsched()    spl7()
  2196.   
  2197. ! #define splx(s)         (s & PSL_IPL ? _spl_no_check(s) : spl0())
  2198.   
  2199.   #ifdef KERNEL
  2200. --- 201,212 ----
  2201.   #define splbio()    spl3()
  2202.   #define splimp()    spl3()
  2203.   #define spltty()    spl4()
  2204. ! #define splclock()    spl4()
  2205. ! #define splstatclock()    spl4()
  2206. ! #define splvm()        spl4()
  2207. ! #define splhigh()    spl4()
  2208. ! #define splsched()    spl4()
  2209.   
  2210. ! #define splx(s)         _spl_no_check(s)
  2211.   
  2212.   #ifdef KERNEL
  2213. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/include/trap.h sys/arch/amiga/include/trap.h
  2214. *** sys.orig/arch/amiga/include/trap.h    Tue Dec 20 09:33:18 1994
  2215. --- sys/arch/amiga/include/trap.h    Tue Dec 27 19:44:39 1994
  2216. ***************
  2217. *** 6,8 ****
  2218. --- 6,14 ----
  2219.   #include <m68k/trap.h>
  2220.   
  2221. + /*
  2222. +  * make sure we don't have this one defined, it's no longer done
  2223. +  * with the REI emulation.
  2224. +  */
  2225. + #undef T_SSIR
  2226.   #endif
  2227. diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/stand/videomode/videomode.c sys/arch/amiga/stand/videomode/videomode.c
  2228. *** sys.orig/arch/amiga/stand/videomode/videomode.c    Tue Dec 20 09:33:19 1994
  2229. --- sys/arch/amiga/stand/videomode/videomode.c    Sun Dec 25 05:22:28 1994
  2230. ***************
  2231. *** 4,7 ****
  2232. --- 4,8 ----
  2233.   #include <sys/stat.h>
  2234.   #include <sys/ioctl.h>
  2235. + #include <sys/device.h>
  2236.   #include "../../dev/grfioctl.h"
  2237.   #include "../../dev/grfvar.h"
  2238.